14.5  SCADA Node as Modbus Slave (i.e a Modbus Server)

The SCADA node, including Windows CE version, will act as a Modbus Ethernet Slave Device (i.e. look like a PLC).  This is also referred  as a Modbus Server. This device emulation feature is usually used to:

or

MODDEF.INI

By creating a MODDEF.INI file in the \WebAccess\node\Project_SCADANode\ folder, the SCADA node will respond to Modbus Master requests.  (If this file is created on the project Node under \WebAccess\node\config\Project_SCADANode, it can be downloaded to the SCADA node during the next download).

The user must map tags to Modbus addresses in the MODDEF.INI

WebAccess supports 16-bit words, standard and reverse word order for 32-bit data in.  

An example MODDEF.INI is as follows:

 

 

[MOD_DEF]

 

LISTEN_PORT= 505

TOTAL_TAG = 7

 

TAG1=40001,TM_65,0

TAG2=40002,SIN_65,4

TAG3=40004,F65_CA01,4

TAG4=40014,F65_CA06,1

TAG5=30001,MD30001,0

TAG6=00001,F65_CD01,0

TAG7=10003,F65_CD_02_ALARM,0

 

Format Description of MODDEF.INI

LISTEN_PORT = port number for TCP/IP, must match WebAccess device configuration, Default:504  If this is specified in Node Properties, then the value in Node properties will be used.  If the value for Modbus Listening Port in node properties is blank, then this value will be used.

TOTAL_TAG = Total tags to be read

TAGn=ModBus_Address,WebAccess_TagName,Type

n= 1 to total_tag

ModBus_Address = 0xxxx, 1xxxx, 3xxxx, 4xxxx

40001 to 49999  is read / write analog register
(16 bit is one register,
32 bit reads/writes two consecutive registers)

30001 to 39999 is read analog register (16 bit is one register,
32 bit reads/writes two consecutive registers)

00001 to 09999 is read/write coil or bit (usually 1 bit)

10001 to 19999 is read coil or bit (usually 1 bit)

WebAccess_TagName = Point(Tag) Name in Local SCADA node

Type 0 = Unsigned 16-bit integer

Type 1 = Signed 16-bit integer

Type 2 = Unsigned 32-bit integer

Type 3 = Signed 32-bit integer

Type 4 = 32-bit Floating points.

Type 5 = Double Precision (Low word*10000+ low word)

Type 6 = Unsigned 32-bit integer, Low reg *65536 + high reg

Type 7 = Signed 32-bit integer, Low reg *65536 + high reg

Type 8 = 32-bit Floating point, reverse word order

 

Serial Port server

WebAccess can also act as a Modbus Server over a Serial Comport.  It mimics a PLC.

 The Modbus definition file (named moddef.ini locates at drive:\WebAccess\Node) should look like:

 

 

[MOD_DEF]

 

LISTEN_PORT= 502

TOTAL_TAG = 7

 

TAG1=40001,TM_65,0

TAG2=40002,SIN_65,4

TAG3=40004,F65_CA01,4

TAG4=40014,F65_CA06,1

TAG5=30001,MD30001,0

TAG6=00001,F65_CD01,0

TAG7=10003,F65_CD_02_ALARM,0

 

[serial]

com=3

baud_rate=19200

data_bit=8

stop_bit=1

MainParity=N

device_unit_no=1

 

 

[Format Description]

LISTEN_PORT = port number for TCP/IP, must match WebAccess device configuration, Default:504

TOATL_TAG = Total tags to be read

TAGn=ModBus_Address,WebAccess_TagName,Type

n= 1 to total_tag

ModBus_Address = 0xxxx, 1xxxx, 3xxxx, 4xxxx

WebAccess_TagName = Point(Tag) Name in Local SCADA node

Type 0 = Unsigned 16-bit integer

Type 1 = Signed 16-bit integer

Type 2 = Unsigned 32-bit integer

Type 3 = Signed 32-bit integer

Type 4 = 32-bit Floating point