Using FieldServers in ModbusTCP Applications
Using FieldServers in ModbusTCP Applications
Using FieldServers in ModbusTCP Applications
DI32
Poll
Metasys DI
Default Type = Bit
No typecasting
occurs. Data
Array is treated as
type Uint16 to
Match variable
type
Packed Bit Data Array
Poll
No typecasting
occurs. Data
Array is treated as
type Bit to match
variable type
/ / ================================================================================
/ /
/ / Dat a Ar r ays
/ / Packed_Bi t i s enabl ed mer el y by decl ar i ng t he dat a ar r ay t o be
/ / of t ype: Packed_Bi t
Dat a_Ar r ays
Dat a_Ar r ay_Name , Dat a_For mat , Dat a_Ar r ay_Lengt h
Packer , Packed_Bi t , 200
Configuration Tips
Configuration Tips
Modbus as a slave Modbus as a slave Keep data map Keep data map large large contiguous contiguous
Why? Because you don Why? Because you don t know how a client will structure its poll, and if it polls for t know how a client will structure its poll, and if it polls for undefined undefined
points, the poll will fail. points, the poll will fail.
Client side Data
Array 1
Client side Data
Array 4
Client side Data
Array 2
Client side Data
Array 3
Server Side
Data Array
Moves
Remote
Client can
now poll the
FieldServer
using large
poll lengths
without fear
of hitting
undefined
registers.
1 Server
Data Array
means 1
Server map
descriptor is
possible
Configuration Tips
Configuration Tips
Configuring Data Moves
Configuring Data Moves
/ / ================================================================================
/ /
/ / Dat a Ar r ays
/ /
/ / Decl ar e Dat a Ar r ays f or t he dat a t o be moved. I n t he r eal wor l d exampl e,
/ / t he Dat a Ar r ays may al r eady be decl ar ed.
/ /
Dat a_Ar r ays
Dat a_Ar r ay_Name , Dat a_For mat , Dat a_Ar r ay_Lengt h
Sour ce_DA , Fl oat , 200
Tar get _DA , Fl oat , 200
/ / ================================================================================
/ /
/ / Set up t he moves t o move t he dat a.
/ /
Moves
Sour ce_Dat a_Ar r ay , Sour ce_Of f set , Tar get _Dat a_Ar r ay , Tar get _Of f set , Lengt h , Funct i on
Sour ce_DA , 0 , Tar get _DA , 40 , 20 , Move_Onl y
Configuration Tips
Configuration Tips
Help! I Help! I m getting m getting could not create cache block could not create cache block
This error occurs frequently when the FieldServer is configured This error occurs frequently when the FieldServer is configured as a as a modbus modbus
slave slave
It means that the FieldServer has received a poll for addresses It means that the FieldServer has received a poll for addresses that do not that do not
exist in the FieldServer under any one Server map descriptor. exist in the FieldServer under any one Server map descriptor.
The content of the error message will tell what poll was receive The content of the error message will tell what poll was received. The d. The
message can be message can be intepreted intepreted as follows: as follows:
T02> MODBUS_TCP : Could not create cache block T02> MODBUS_TCP : Could not create cache block
T02> Node:1 Addr:40001 Len:100 T02> Node:1 Addr:40001 Len:100
Server Node
being polled
Modbus
Address being
polled
Length of poll
Configuration Tips
Configuration Tips
Managing Floating point values with Integers Managing Floating point values with Integers - - Scaling Scaling
Map_Descr i pt or s
Node_Name , Addr ess , Lengt h , Dat a_Ar r ay_Low_Scal e , Dat a_Ar r ay _Hi gh_Scal e , Node_Low_Scal e , Node_Hi gh_Scal e
MBP_Sr v_1 , 30001 , 200 , 0 , 10 , 0 , 100
Data Array
-------------------------
Offset 0: 26.4
-------------------------
Offset 1: 32.5
-------------------------
X10
Remote Device
-------------------------
Offset 0: 264
-------------------------
Offset 1: 325
-------------------------
Configuration Tips
Configuration Tips
Making two Making two modbus modbus Slaves talk to each other using the FieldServer Slaves talk to each other using the FieldServer
Slaves are passive, so they cannot Slaves are passive, so they cannot independantly independantly request data from each other. request data from each other.
Insert the FieldServer as a Master, read the data from one slave Insert the FieldServer as a Master, read the data from one slave, and then write it to the other , and then write it to the other
Wrbc Wrbc is normally the best function for writing status data is normally the best function for writing status data
Moves may be necessary to separate responsible map descriptors Moves may be necessary to separate responsible map descriptors
Data Array 1 Data Array 2
Rdbc Wrbc
Move
Server 1
Passive client
Configuration Tips
Configuration Tips
Helping Clients share data Helping Clients share data
Passive Server map descriptors can reference the same data array Passive Server map descriptors can reference the same data array. This means the Data Array . This means the Data Array
can be used as a shared repository for multiple active clients. can be used as a shared repository for multiple active clients.
Network
Protocol A
FieldServer
Client 1 Client 2
Network
Protocol B
This Data Sharing configuration
is useful in applications where
clients on different networks need
to share stored data
The same setup can provide a
passive server/passive client
functionality too
Map descriptor function used for
both protocols A and B is passive
Fieldserver is non-intrusive into
both networks, and responds to
queries and commands only.
Configuration Tips
Configuration Tips
Using the FieldServer to bring Modbus RTU into a Modbus TCP netw Using the FieldServer to bring Modbus RTU into a Modbus TCP network ork
Since the protocol is the same, port expansion can be used. This Since the protocol is the same, port expansion can be used. This requires minimal requires minimal
configuration. configuration.
Full Port expansion configuration example: Full Port expansion configuration example:
Connect i ons
Por t , Baud, Par i t y, Dat a_Bi t s, St op_Bi t s, Pr ot ocol , Handshaki ng, Pol l _Del ay,
R1 , 9600, None , 8 , 1 , Modbus_RTU, None , 0. 100s ,
R2 , 9600, None , 8 , 1 , Modbus_RTU, None , 0. 100s ,
P7 , 9600, None , 8 , 1 , Modbus_RTU, None , 0. 100s ,
P8 , 9600, None , 8 , 1 , Modbus_RTU, None , 0. 100s ,
Connect i ons
Adapt er , Pr ot ocol
N1 , Modbus/ TCP
Nodes
Node_Name, Node_I D, Pr ot ocol , Por t ,
PLC_07 , 7 , Modbus_RTU, P7 ,
PLC_08 , 8 , Modbus_RTU, P8 ,
PLC_11 , 11 , Modbus_RTU, R1 ,
PLC_12 , 12 , Modbus_RTU, R1 ,
PLC_21 , 21 , Modbus_RTU, R2 ,
PLC_22 , 22 , Modbus_RTU, R2 ,
Configuration Tips
Configuration Tips
Monitoring the status of Client side nodes (Servers) Monitoring the status of Client side nodes (Servers) Node Status Node Status
/ / ======================================================================================
/ /
/ / Not es : Al l t hat i s needed t o enabl e node st at us i s t he node st at us dat a ar r ay
/ / decl ar at i on. Not e, t hough, t hat Node I D' s i n t he conf i g need t o be
/ / uni que, ot her wi se t he Fi el dSer ver wi l l i ncor r ect l y r epor t t he st at us of
/ / dupl i cat e Node I D' s
/ /
/ / ======================================================================================
/ / ================================================================================,
/ /
/ / Dat a Ar r ays
/ /
Dat a_Ar r ays
Dat a_Ar r ay_Name , Dat a_For mat , Dat a_Ar r ay_Lengt h , Dat a_Ar r ay_Funct i on
DA_Comm_St at us , Bi t , 256 , Node_St at us
/ / ================================================================================,
/ /
/ / Modbus TCP Ser ver Map Descr i pt or Tur ns 10001 i nt o Nde 1 St at us, 10002=Node 2, et c.
/ /
Map_Descr i pt or s
Map_Descr i pt or _Name, Dat a_Ar r ay_Name, Dat a_Ar r ay_Of f set , Funct i on, Node_Name , Addr ess, Lengt h,
Node_St at us_Map , DA_Comm_St at us , 1 , Ser ver , MBP_Sr v_11, 10001 , 200 ,
Resources
Resources
1) www.fieldserver.com
FieldServer Configuration manual
FieldServer Troubleshooting manual
Modbus TCP Manual
2) www.modbus.org
List of modbus certified vendors
Modbus TCP specification
Application guidelines
3) Vendor sites
Mapping for modbus devices
4) www.ethereal.com
Ethernet packet capture utility
5) www.win-tech.com
Modscan32
Questions?
Questions?
Email Mac at:
Email Mac at:
[email protected]
[email protected]
PH: 408-262-2299, 888-509-1970
Email: [email protected]
www.fieldserver.com
THANK YOU!
THANK YOU!