0% found this document useful (0 votes)
68 views25 pages

Fs 8704 03 Modbus TCP Ip Protocol

Uploaded by

vonton2018
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views25 pages

Fs 8704 03 Modbus TCP Ip Protocol

Uploaded by

vonton2018
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Driver Manual

FS-8704-03 Modbus TCP/IP

APPLICABILITY & EFFECTIVITY


Effective for all systems manufactured after August 2023.

Driver Revision: 1.12


Document Revision: 5.F

Modbus TCP/IP Driver Manual 0


MSAsafety.com
MSA Safety
1000 Cranberry Woods Drive
Cranberry Township, PA 16066 USA
Website: www.MSAsafety.com
U.S. Support Information:
+1 408 964-4443
+1 800 727-4377
Email: [email protected]
EMEA Support Information:
+31 33 808 0590
Email: [email protected]

Modbus TCP/IP Driver Manual 2


Contents
1 Description ........................................................................................................................................ 4
2 Driver Scope of Supply .................................................................................................................... 4
2.1 Provided by the Supplier of 3rd Party Equipment ..................................................................... 4
3 Hardware Connections .................................................................................................................... 5
4 Data Array Parameters..................................................................................................................... 6
5 Client Side Configuration ................................................................................................................ 7
5.1 Client Side Connection Parameters ......................................................................................... 7
5.2 Client Side Node Parameters ................................................................................................... 8
5.3 Client Side Map Descriptor Parameters ................................................................................... 9
5.3.1 FieldServer Specific Map Descriptor Parameters .................................................................... 9
5.3.2 Driver Specific Map Descriptor Parameters ............................................................................. 9
5.3.3 Timing Parameters ................................................................................................................. 10
5.4 Map Descriptor Examples ...................................................................................................... 10
6 Configuring the FieldServer as a Server...................................................................................... 11
6.1 Server Side Connection Parameters ...................................................................................... 11
6.2 Server Side Node Parameters................................................................................................ 12
6.3 Server Side Map Descriptor Parameters................................................................................ 13
6.3.1 FieldServer Specific Map Descriptor Parameters .................................................................. 13
6.3.2 Driver Specific Map Descriptor Parameters ........................................................................... 13
6.4 Map Descriptor Examples ...................................................................................................... 14
6.4.1 Slave_ID ................................................................................................................................. 14
7 Useful Features .............................................................................................................................. 15
7.1 Managing Floating Points with Modbus.................................................................................. 15
7.1.1 Transferring Non-integer Values with One Register .............................................................. 15
7.1.2 Transferring Float/32 bit Values with Two Registers ............................................................. 16
7.2 Node_Offline_Response ........................................................................................................ 17
7.3 Splitting Registers into Bytes or Bits ...................................................................................... 18
7.4 Reading Data Types ............................................................................................................... 18
7.4.1 32-Bit Integer and Float Data Types ...................................................................................... 18
7.4.2 Relinquishing Control of a Point as a Client........................................................................... 19
7.4.3 64-Bit Integer and Float Data Types ...................................................................................... 20
7.5 Reading Device Identification ................................................................................................. 21
7.5.1 Client Side Map Descriptor .................................................................................................... 21
7.5.2 Server Side Map Descriptor ................................................................................................... 21
7.6 Broadcasting Write Messages ................................................................................................ 21
7.7 Reading Scattered Addresses ................................................................................................ 22
8 Troubleshooting ............................................................................................................................. 23
8.1 Server Configuration of System Station Address ................................................................... 23
8.2 Modbus TCP/IP Connection Error Descriptions ..................................................................... 23
8.3 Understanding Max Concurrent Messages ............................................................................ 23
8.4 Error: MB_TCP : Response Failed in mod_build ................................................................... 24
9 Reference ........................................................................................................................................ 25
9.1 Data Types ............................................................................................................................. 25
9.2 Single Writes........................................................................................................................... 25
9.3 Driver Error Messages............................................................................................................ 25

Modbus TCP/IP Driver Manual 3


Description

1 Description
The Modbus TCP Driver allows the FieldServer to transfer data to and from devices over Ethernet using
the Modbus TCP/IP Protocol. The Modbus TCP/IP driver uses port 502, which is not configurable. The
driver was developed for Modbus Application Protocol Specification V1.1a from Modbus-IDA. The
specification can be found at www.modbus.org. The FieldServer can emulate either a Server or Client.
The information that follows describes how to expand upon the factory defaults provided in the configuration
files included with the FieldServer.
There are various register mapping models being followed by various vendors.
To cover all these mappings, FieldServer uses the following three Models:
• Modicon_5digit – Use this format where addresses are defined in 0xxxx, 1xxxx, 3xxxx or 4xxxx
format. A maximum of 9999 registers can be mapped of each type. This is FieldServer driver’s
default format.
• ADU – Application Data Unit address. Use this format where addresses of each type are defined
in the range 1-65536.
• PDU – Protocol Data unit address. Use this format where addresses of each type are defined in
the range 0-65535.
An example of the key difference between ADU and PDU:
• If Address_Type is ADU and address is 1, the driver will poll for register 0.
• If Address_Type is PDU, the driver will poll for address 1.
NOTE: If the vendor document shows addresses in extended Modicon (i.e. 6 digit) format like
4xxxxx then consider these addresses as xxxxx (omit the first digit) and use either ADU or
PDU.
NOTE: The purpose of providing 3 different ways of addressing the Modbus registers is to allow
the user to choose the addressing system most compatible with the address list being
used. At the protocol level, the same protocol specification is used for all three with the
exception of the limited address range for Modicon_5digit.

2 Driver Scope of Supply

2.1 Provided by the Supplier of 3 r d Party Equipment


Description
Modbus/TCP Server, e.g. Quantum PLC 1
Modbus/TCP Host Node [such as: Intellution Fix, Wondereware Intouch, GE Cimplicity, Quantum PLC
(Master)]2

1
If FieldServer is used as a Modbus/TCP Client.
2
If FieldServer is used as a Modbus/TCP Server.

Modbus TCP/IP Driver Manual 4


Installing the FieldServer

3 Hardware Connections
Configure the PLC according to manufacturer’s instructions.

Remote Modbus
Device

Switch

FieldServer Part #
8915-10
UTP cable

Connect to an Ethernet Port


on the FieldServer

9 1

FieldServer
N1

Modbus TCP/IP Driver Manual 5


Configuring the FieldServer

4 Data Array Parameters


Data Arrays are “protocol neutral” data buffers for storage of data to be passed between protocols. It is
necessary to declare the data format of each of the Data Arrays to facilitate correct storage of the relevant
data.

Section Title
Data_Arrays
Column Title Function Legal Values
Up to 15 alphanumeric
Data_Array_Name Provide name for Data Array.
characters
Provide data format. Each Data Array can only take Float, Bit, Byte, Uint16,
Data_Array_Format
on one format. Uint32, Sint16, Sint32
Number of Data Objects. Must be larger than the
Data_Array_Length data storage area required by the Map Descriptors 1 – 255
for the data being placed in this array.

Example
// Data Arrays
Data_Arrays
Data_Array_Name , Data_Array_Format , Data_Array_Length
DA_AI_01 , UInt16, , 200
DA_AO_01 , UInt16 , 200
DA_DI_01 , Bit , 200
DA_DO_01 , Bit , 200

Modbus TCP/IP Driver Manual 6


Configuring the FieldServer

5 Client Side Configuration


For detailed information on FieldServer configuration, refer to the FieldServer Configuration Manual. The
information that follows describes how to expand upon the factory defaults provided in the configuration
files included with the FieldServer (see “.csv” sample files provided with the FieldServer).
This section documents and describes the parameters necessary for configuring the FieldServer to
communicate with a Modbus TCP/IP Server.
The configuration file tells the FieldServer about its interfaces, and the routing of data required. In order to
enable the FieldServer for Modbus TCP/IP communications the following three actions must be taken. The
driver independent FieldServer buffers need to be declared in the “Data Arrays” section. The destination
device addresses need to be declared in the “Client Side Nodes” section. And the data required from the
server(s) needs to be mapped in the “Client Side Map Descriptors” section. Details on how to perform these
steps can be found in the following sections.
NOTE: If the Dual Ethernet FieldServer is a client on N1 and a server on N2 using the same
protocol, the TCP or UDP ports need to be unique among the N1 and N2 ports.
NOTE: In the following tables, * indicates an optional parameter and bold legal values are default.

5.1 Client Side Connection Parameters


Section Title
Connections
Column Title Function Legal Values
Adapter Specify which adapter this protocol uses. N1-N2, WLAN3
Protocol Specify protocol used. Modbus/TCP
Poll Delay* Time interval between polls. 0-32000 s, 0.05 s
0 – 65534
(0 or 1 disables
Specify the maximum messages the driver
Max_Concurrent_Messages*4 concurrent messaging
can send, before waiting for responses.
meaning only 1 active
message at a time)

Example:
// Client Side Connections

Connections
Adapter , Protocol , Poll_Delay
N1 , Modbus/TCP , 0.05s

3
Not all ports shown are necessarily supported by the hardware. Consult the appropriate Instruction manual for details of the ports
available on specific hardware.
4
Using Max_Concurrent_Messages value > 1 could improve communication performance, but it also depends on the remote
Server’s implementation. The server might not support multiple messaging, so match this number with the Server's capability.

Modbus TCP/IP Driver Manual 7


Configuring the FieldServer

5.2 Client Side Node Parameters


Section Title
Nodes
Column Title Function Legal Values
Up to 32 alphanumeric
Node_Name Provide name for node.
characters
Node_ID Station Address of Remote Server Node. 0 – 255
Protocol Specify protocol used. Modbus/TCP
Adapter Specify which adapter this protocol uses. N1-N2, WLAN5
Valid IP address (for
IP_address IP address of client PLC.
example - 192.168.1.13)
ADU, PDU,
Address_Type6 Specify Register Mapping Model.
Modicon_5digit
Modbus_TCP_IP_Port* Select remote Internet Protocol Port. 1-65534, 502
Set to Multiple if Remote Server Node only
Write_Fnc* Multiple, -
supports Write Multiple function code 15 & 16.
Set to MD_Length if write-thru operation should
write all registers as specified by MD_Length.
Write_Length* By default, write-thru writes a single register. MD_Length, -, 1
If Write_Length also specified on Map
Descriptor, Map Descriptor’s parameter will be
used.

Example
// Client Side Nodes for new devices where 65536 registers are available in each memory area

Nodes
Node_Name , Node_ID , Protocol , Adapter , Address_Type , IP_Address
Modbus device 1 ,1 , Modbus/TCP , N1 , ADU , 192.168.1.172

// Client Side Nodes for devices where only 9999 registers are available in each memory area

Nodes
Node_Name , Node_ID , Protocol , Adapter , IP_Address
Modbus device 3 ,3 , Modbus/TCP , N1 , 192.168.1.172

5
Not all ports shown are necessarily supported by the hardware. Consult the appropriate Instruction manual for details of the ports
available on specific hardware.
6
Optional for Modicon 5 digit devices.

Modbus TCP/IP Driver Manual 8


Configuring the FieldServer

5.3 Client Side Map Descriptor Parameters

5.3.1 FieldServer Specific Map Descriptor Parameters


Column Title Function Legal Values
Map_Descriptor_Name Name of this Map Descriptor. Up to 32 alphanumeric characters
Name of Data Array where data is to One of the Data Array names from
Data_Array_Name
be stored in the FieldServer. Section 4
0 to (Data_Array_Length -1) as
Data_Array_Offset Starting location in Data Array.
specified in Section 4
Function Function of Client Map Descriptor. RDBC, WRBC, WRBX, Passive

5.3.2 Driver Specific Map Descriptor Parameters


Column Title Function Legal Values
One of the Node names specified in
Node_Name Name of Node to fetch data from.
Section 5.2
Address_Type = ADU
Coil, Discrete_Input, Input_Register,
Holding_Register, Single_Coil,
Single_Register, Slave_ID
Address_Type = PDU
FC01, FC02, FC03, FC04,
FC05, FC06, FC15, FC16
Address_Type = Modicon_5digit
- (Dash), Single_Register, Single_Coil
All Address_Type
Specify memory area. Refer to
Float_Reg, 32Bit_Reg, Input_Float,
Section 7.1.2 on how to transfer
Data_Type7 Input_Reg_32Bit, Float_Reg_Swap,
32 Bit values using Modbus
registers. 32Bit_Reg_Swap, Input_Float_Swap,
Input_Reg_32Bit_Swap
(Section 7.4.1);
Input_Reg_64Bit, 64Bit_Reg,
Input_Double, Double_Reg
(Section 7.4.3);
Reg_Bytes, Input_Reg_Bytes,
Reg_Bits, Input_Reg_Bits (Section
7.3);
Device_ID (Section 7.5.1)
Address_Type = ADU
1-65536
Address_Type = PDU
0-65535
Address Starting address of read block. Address_Type = Modicon_5digit
40001, 30001, etc.
Address_Type
Float_Reg, 32-Bit_Reg, Input_Float,
Input_Reg_32Bit
1-125 (for Analog polls),
Length* Length of Map Descriptor.
1-800 (for Binary polls)

7
Optional only for Modicon_5digit addressing, and only if Single writes do not need to be forced.

Modbus TCP/IP Driver Manual 9


Configuring the FieldServer

List of addresses separated by a


Specify additional addresses to
Scattered_Addresses* space, all within quotation marks
read on this map descriptor.
(Section 7.7)
Set to MD_Length if write-thru
operation should write all
Write_Length* registers as specified by length MD_Length, -, 1
parameter. By default, write-thru
writes a single register.
Any signed 32 bit integer in the range:
Data_Array_Low_Scale* Scaling zero in Data Array.
-2,147,483,648 to 2,147,483,647, 0
Any signed 32 bit integer in the range:
Data_Array_High_Scale* Scaling max in Data Array.
-2,147,483,648 to 2,147,483,647, 100
Any signed 32 bit integer in the range:
Node_Low_Scale* Scaling zero in Connected Node.
-2,147,483,648 to 2,147,483,647, 0
Any signed 32 bit integer in the range:
Node_High_Scale* Scaling max in Connected Node.
-2,147,483,648 to 2,147,483,647, 100
Only used with Data_Type
Object_ID* 0- 6 (Section 7.5.1)
Device_ID.

5.3.3 Timing Parameters


Column Title Function Legal Values
Scan_Interval* Rate at which data is polled. 0-32000, 20

5.4 Map Descriptor Examples


All three examples below are addressing the same Modbus registers:
// Client Side Map Descriptors for Nodes where Address_Type is ADU

Map_Descriptors
Map_Descriptor_Name , Data_Array_Name , Data_Array_Offset , Function , Node_Name , Data_Type , Address , Length , Scan_Interval
CMD_AI_01 , DA_AI_01 ,0 , Rdbc , MODBUS DEVICE1 , Input_Register , 1 , 20 , 1.000s
CMD_AO_01 , DA_AO_01 ,0 , Rdbc , MODBUS DEVICE1 , Holding_Register , 1 , 20 , 1.000s
CMD_DI_01 , DA_DI_01 ,0 , Rdbc , MODBUS DEVICE1 , Discrete_Input , 1 , 20 , 1.000s
CMD_DO_01 , DA_DO_01 ,0 , Rdbc , MODBUS DEVICE1 , Coil ,1 , 20 , 1.000s

// Client Side Map Descriptors for Nodes where Address_Type is PDU

Map_Descriptors
Map_Descriptor_Name , Data_Array_Name , Data_Array_Offset , Function , Node_Name , Data_Type , Address , Length , Scan_Interval
CMD_AI_02 , DA_AI_02 ,0 , Rdbc , MODBUS DEVICE2 , FC04 ,0 , 20 , 1.000s
CMD_AO_02 , DA_AO_02 ,0 , Rdbc , MODBUS DEVICE2 , FC03 ,0 , 20 , 1.000s
CMD_DI_02 , DA_DI_02 ,0 , Rdbc , MODBUS DEVICE2 , FC02 ,0 , 20 , 1.000s
CMD_DO_02 , DA_DO_02 ,0 , Rdbc , MODBUS DEVICE2 , FC01 ,0 , 20 , 1.000s

// Client Side Map Descriptors for Nodes where Address_Type is Modicon_5digit

Map_Descriptors
Map_Descriptor_Name , Data_Array_Name , Data_Array_Offset , Function , Node_Name
CMD_AI_03 , DA_AI_03 ,0 , Rdbc , MODBUS DEVICE3
CMD_AO_03 , DA_AO_03 ,0 , Rdbc , MODBUS DEVICE3
CMD_DI_03 , DA_DI_03 ,0 , Rdbc , MODBUS DEVICE3
CMD_DO_03 , DA_DO_03 ,0 , Rdbc , MODBUS DEVICE3

, Address , Length , Scan_Interval Map_Descriptor_Name


, 30001 , 20 , 1.000s CMD_AI_03
, 40001 , 20 , 1.000s CMD_AO_03
, 10001 , 20 , 1.000s CMD_DI_03
, 00001 , 20 , 1.000s CMD_DO_03

Modbus TCP/IP Driver Manual 10


Configuring the FieldServer

6 Configuring the FieldServer as a Server


For detailed information on FieldServer configuration, refer to the FieldServer Configuration Manual. The
information that follows describes how to expand upon the factory defaults provided in the configuration
files included with the FieldServer (see “.csv” sample files provided with the FieldServer).
This section documents and describes the parameters necessary for configuring the FieldServer to
communicate with a Modbus TCP/IP Client.
The configuration file tells the FieldServer about its interfaces, and the routing of data required. In order to
enable the FieldServer for Modbus TCP/IP communications the following three actions must be taken. The
driver independent FieldServer buffers need to be declared in the “Data Arrays” section. The FieldServer
virtual Node(s) need to be declared in the “Server Side Nodes” section. And the data to be provided to the
client(s) needs to be mapped in the “Server Side Map Descriptors” section. Details on how to perform these
steps can be found in the following sections.
NOTE: If the Dual Ethernet FieldServer is a client on N1 and a server on N2 using the same
protocol, the TCP or UDP ports need to be unique among the N1 and N2 ports.
NOTE: In the following tables, * indicates an optional parameter and bold legal values are default.

6.1 Server Side Connection Parameters


Section Title
Connections
Column Title Function Legal Values
Adapter Specify which adapter this protocol uses. N1-N2, WLAN8
IP_Port Specify internet protocol Port. 1-65534
Protocol Specify protocol used. Modbus/TCP
Sets the time to wait for a message frame to complete
0 (disabled), 1 - 100
on the network. This is useful on busy Modbus
Framing_Timeout* milliseconds, 100
networks where unknown messages for other devices
may cause longer timeouts.
The maximum sessions that will be accepted by the
server side. Any connection requests after the number
Max_Sessions* 1-65534, 20
of open sessions reaches this number will result in the
session that was last active being closed.
Specify the connection inactivity timeout in seconds.
Inactivity_Timeout* The FieldServer will close the connection opened by 0 – 4294967, 60
the client if there is no activity for this time period.
Accept_Broadcast* Specify server to accept broadcast messages. Yes, No
Enable or disable the ability to parse multiple
Multiple_Server_
messages in a stream. Selecting “No” will only parse Yes, No
Messages*
the first message and discard the rest.
Example
// Server Side Connections
Connections
Adapter , Protocol
N1 , Modbus/TCP

8
Not all ports shown are necessarily supported by the hardware. Consult the appropriate Instruction manual for details of the ports
available on specific hardware.

Modbus TCP/IP Driver Manual 11


Configuring the FieldServer

6.2 Server Side Node Parameters


Section Title
Nodes
Column Title Function Legal Values
Up to 32 alphanumeric
Node_Name Provide name for node.
characters
Node_ID Node ID of physical Server Node. 0 – 255 (optional)
Protocol Specify protocol used. Modbus/TCP
ADU, PDU,
Address_Type*9 Specify Register Mapping Model.
Modicon_5digit
Gateway_Device_Failed,
Exception_B,
Set the FieldServer response to the Modbus No_Response,
Node_Offline_Response* TCP/IP Client when the Server Node Old_Data,
supplying the data has gone offline. Zero_Data,
FFFF_Data;
see Section 7.2
Any string up to 99
Node_Description* Specify Node description text.
characters long, -
Set the FieldServer’s response to the Modbus Do_not_Respond,
Partial_Data_Response* TCP/IP Client request when addresses are Fill_Gaps_With_Zero,
not defined in the Map Descriptor section. Fill_Gaps_With_FFFF

NOTE: For this protocol, the IP address for the FieldServer is configured using the "I" menu
option on the Remote User Interface.
Example
// Server Side Nodes for new devices where 65536 registers are available in each memory area

Nodes
Node_Name , Node_ID , Protocol , Address_Type
MB_Srv_11 , 11 , Modbus/TCP , ADU
MB_Srv_12 , 12 , Modbus/TCP , PDU

// Server Side Nodes for devices where only 9999 registers are available in each memory area

Nodes
Node_Name , Node_ID , Protocol , Address_Type
MB_Srv_13 , 13 , Modbus/TCP , Modicon_5digit
MB_Srv_14 , 14 , Modbus/TCP ,-

9
Optional for Modicon 5 digit devices.

Modbus TCP/IP Driver Manual 12


Configuring the FieldServer

6.3 Server Side Map Descriptor Parameters


6.3.1 FieldServer Specific Map Descriptor Parameters
Column Title Function Legal Values
Map_Descriptor_Name Name of this Map Descriptor. Up to 37 alphanumeric characters
Name of Data Array where data is to One of the Data Array names from
Data_Array_Name
be stored in the FieldServer. Section 4
0 to (Data_Array_Length-1) as
Data_Array_Offset Starting location in Data Array.
specified in Section 4
Function Function of Server Map Descriptor. Passive, server

6.3.2 Driver Specific Map Descriptor Parameters


Column Title Function Legal Values
The name of the Node being One of the Node names specified in
Node_Name
represented. Section 6.2
Address_Type = ADU
Coil, Discrete_Input, Input_Register,
Holding_Register, Single_Coil,
Single_Register, Slave_ID (Section
6.4.1)
Address_Type = PDU
Data_Type10 Specify memory area.
FC01, FC02, FC03, FC04,
FC05, FC06, FC15, FC16
Address_Type = Modicon_5digit
- (Dash), Single_Register, Single_Coil
All Address_Type
Device_ID (Section 7.5.1)
Address_Type = ADU
1-65536
Starting address of read Address_Type = PDU
Address
block. 0-65535
Address_Type = Modicon_5digit
40001, 30001, etc.
Address_Type = ADU
1-65536
Address_Type = PDU
Length* Length of Map Descriptor.
1-65536
Address_Type = Modicon_5digit
1-9999
Any signed 32 bit integer in the range:
Data_Array_Low_Scale* Scaling zero in Data Array.
-2147483648 to 2147483647, 0
Any signed 32 bit integer in the range:
Data_Array_High_Scale* Scaling max in Data Array.
-2147483648 to 2147483647, 100
Scaling zero in connected Any signed 32 bit integer in the range:
Node_Low_Scale*
Node. -2147483648 to 2147483647, 0
Scaling max in connected Any signed 32 bit integer in the range:
Node_High_Scale*
Node. -2147483648 to 2147483647, 100

10
Optional only for Modicon_5digit addressing, and only if Single writes do not need to be forced.

Modbus TCP/IP Driver Manual 13


Configuring the FieldServer

6.4 Map Descriptor Examples


All three examples below are addressing the same Modbus registers:
// Client Side Map Descriptors for Nodes where Address_Type is ADU

Map_Descriptors
Map_Descriptor_Name , Data_Array_Name , Data_Array_Offset , Function , Node_Name , Data_Type , Address
SMD_AI_01 , DA_AI_01 ,0 , Passive , MB_Srv_11 , Input_Register ,1
SMD_AO_01 , DA_AO_01 ,0 , Passive , MB_srv_11 , Holding_Register ,1

, Data_Array_Low_Scale , Data_Array_High_Scale , Node_Low_Scale , Node_High_Scale


,0 , 100 ,0 , 10000
,0 , 100 ,0 , 10000

// Client Side Map Descriptors for Nodes where Address_Type is PDU

Map_Descriptors
Map_Descriptor_Name , Data_Array_Name , Data_Array_Offset , Function , Node_Name , Data_Type , Address
SMD_AI_02 , DA_AI_02 ,0 , Passive , MB_Srv_12 , FC04 ,0
SMD_AO_02 , DA_AO_02 ,0 , Passive , MB_srv_12 , FC03 ,0

, Data_Array_Low_Scale , Data_Array_High_Scale , Node_Low_Scale , Node_High_Scale


,0 , 100 ,0 , 10000
,0 , 100 ,0 , 10000

// Client Side Map Descriptors for Nodes where Address_Type is Modicon_5digit

Map_Descriptors
Map_Descriptor_Name , Data_Array_Name , Data_Array_Offset , Function , Node_Name , Address , Length
SMD_AI_01 , DA_AI_01 ,0 , Passive , MBP_Srv_13 , 30001 , 200
SMD_AO_01 , DA_AO_01 ,0 , Passive , MBP_Srv_13 , 40001 , 200

, Data_Array_Low_Scale , Data_Array_High_Scale , Node_Low_Scale , Node_High_Scale


,0 , 100 ,0 , 10000
,0 , 100 ,0 , 10000

6.4.1 Slave_ID
The Node_Description will automatically be used to respond to the Report Slave_ID request (Function Code
17 or FC17). If the Node_Description is not defined the title in the common information section will be used
as the description in the Slave_ID response.

Slave_ID Lookup in Table


The Slave_ID will be read from device PLC_21. The response will be searched for occurrences of the
strings in the table in column table string. If a match is found the user value will be written.
The Table_String must occur in the Slave_ID in any position.
Config_Table
Config_Table_Name , Table_String , Table_Index_Value , Table_User_Value
slave_id_profile , FS01 ,1 ,1
slave_id_profile , FS02 ,2 ,2
slave_id_profile , FS03 ,3 ,3

Map_Descriptors
Map_Descriptor_Name , Data_Array_Name , Data_Array_Offset , Function , Node_Name , Scan_Interval
CMD_DO_01 , DA_DO_01 ,0 , RDBC , PLC_21 , 0.000s

, Data_Type , Length , Config_Table_Name


, Slave_Id ,1 , slave_id_profile

Modbus TCP/IP Driver Manual 14


Additional Information

7 Useful Features

7.1 Managing Floating Points with Modbus


Modbus as a standard does not support floating point formats. Many vendors have written higher level
communications software to use two 16 bit registers to represent floating point or 32 bit integers. This
requires conversion software on both ends of the communication channel. The FieldServer supports this
function and also provides other options to resolve this issue.

7.1.1 Transferring Non-integer Values with One Register


It is possible to represent values higher than 32767 using one register in one of two ways:
• Declare data arrays as type Uint16 (Unsigned integer); this allows a range from 0 to 65535.
• Use the scaling function on the FieldServer, which allows any range with 16 bit resolution.
The following example shows how scaling can be achieved on the Server side of the configuration.
NOTE: Scaling can also be done on the Client side to scale down a value that was scaled up by a
Modbus vendor. Further information regarding scaling, refer to the FieldServer
Configuration Manual, found on the Sierra Monitor website.
Example
Map_Descriptors
Map_Descriptor_Name , Data_Array_Name , Data_Array_Offset , Function , Node_Name , Address , Length
SMD_AI1 , DA_AI_01 ,0 , Passive , MBP_Srv_11 , 30001 , 200
SMD_AO1 , DA_AO_01 ,0 , Passive , MBP_Srv_11 , 40001 , 200

, Data_Array_Low_Scale , Data_Array_High_Scale , Node_Low_Scale , Node_High_Scale


,0 , 100 ,0 , 10000
,0 , 100 ,0 , 10000

This example multiplies the values in the data array by 100 (10000 on Node_High_Scale is 100X larger
than 100 on Data_Array_High_Scale). This is most commonly used when the user wants to introduce
values after the decimal point. For example, a value of 75.6 will be sent as 7560, which can then be rescaled
by the Modbus master.

Modbus TCP/IP Driver Manual 15


Additional Information

7.1.2 Transferring Float/32 bit Values with Two Registers


If a Modbus Server sends two consecutive registers to the FieldServer representing either a floating point
value or a 32 bit integer value, the FieldServer can combine and decode these registers back into their
original format. To do this, declare Data Array of type Float or UINT32 and set the Map Descriptor
Data_Type as ‘Float_Reg’, ‘32Bit_Reg’, etc.
Example
Data_Arrays
Data_Array_Name , Data_Format , Data_Array_Length
DA1 , Float , 20
DA2 , UInt32 , 20
DA3 , Float , 20
DA4 , UInt32 , 20

// Client Side Map Descriptors where Nodes where Address_Type is PDU


Map_Descriptors
Map_Descriptor_Name , Data_Array_Name , Data_Array_Offset , Function , Node_Name,
CMD_AO_01 , DA1 ,0 , Rdbc , Modbus Device2
CMD_AO_02 , DA2 ,0 , Rdbc , Modbus Device2
CMD_AI_01 , DA3 ,0 , Rdbc , Modbus Device2
CMD_AI_02 , DA4 ,0 , Rdbc , Modbus Device2

, Data_Type , Address , Length ,Scan_Interval


, Float_Reg ,0 , 20 ,1.000s
, 32Bit_Reg ,0 , 20 ,1.000s
, Input_Float ,0 , 20 ,1.000s
, Input_Reg_32Bit ,0 , 20 ,1.000s

Each Map Descriptor will read 20 pairs of registers and store them as a 32-bit floating number or a 32-bit
Integer.
If the server device sends swapped registers (low value register first) then use the corresponding _swap
data_types.
NOTE: The value in the address parameter can be ADU, PDU or Modicon 5-digit types; see
Section 5.3.2.

Modbus TCP/IP Driver Manual 16


Additional Information

7.2 Node_Offline_Response
In systems where data is being collected from multiple Server Nodes and made available on a FieldServer
configured as a Modbus TCP/IP Server, when a Server Node goes offline the default behavior of the
FieldServer would be to stop responding to polls for this data. This might not be what the user wants.
Various options exist making it possible to signal that the data quality has gone bad without creating error
conditions in systems sensitive to the default option.
The following options can be configured under the Node parameter, Node_Offline_Response, to set the
response of the FieldServer to the Modbus TCP/IP Client when the Server Node supplying the data is
offline:
• No_Response - This is the default option. The FieldServer simply does not respond when the
corresponding Server Node is offline.
• Old_Data - The FieldServer responds with the last known data value. This maintains the
communication link in an active state, but may hide the fact that the Server Node is offline.
• Zero_Data - The FieldServer responds with the data values set to zero. If the user expects non-
zero values, this option will signal the offline condition without disrupting communications.
• FFFF_Data - The FieldServer responds with data values set to FFFF (hex). If the user expects
other values, this option will signal the offline condition without disrupting communications.
When configured as a Server this parameter can force a desired exception response as follows:
• Node_Offline_Message or Exception_4 - FieldServer's response will be Exception 4.
• Gateway_Path_Unavailable or Exception_A - FieldServer's response will be Exception A.
• Gateway_Device_Failed or Exception_B - FieldServer's response will be Exception B.
Example
Nodes
Node_Name , Node_ID , Protocol , Node_Offline_Response , Port
DEV11 , 11 , Modbus/TCP , No_Response ,-
DEV12 , 12 , Modbus/TCP , Old_Data ,-
DEV15 , 15 , Modbus/TCP , Zero_Data ,-
DEV16 , 16 , Modbus/TCP , FFFF_Data ,-
DEV17 , 17 , Modbus/TCP , Exception_4 ,-
DEV18 , 18 , Modbus/TCP , Gateway_Path_Unavailable ,-

Modbus TCP/IP Driver Manual 17


Additional Information

7.3 Splitting Registers into Bytes or Bits


Sometimes it is required to split a register into Bytes or bits. The following Map Descriptors read registers
and store the bytes/bits in consecutive data array locations. The FieldServer will store the least significant
byte/bit at the 1st offset and will continue sequentially. To implement this feature, declare a Data Array with
Data_Format Byte or bit and use that Data_Array_Name when setting up the Map_Descriptor parameters.
In the Map_Descriptors, set Data_Type as ‘Reg_Bytes’ or ‘Reg_Bits’ according to the Data_Format of the
Data_Array.
Example
Data_Arrays
Data_Array_Name , Data_Format , Data_Array_Length
DA1 , Byte , 40
DA2 , Byte , 40
DA3 , Bit , 320
DA4 , Bit , 320

//Client Side Map Descriptors for Nodes where Address_Type is PDU

Map_Descriptors
Map_Descriptor_Name , Data_Array_Name , Data_Array_Offset , Function , Node_Name , Data_Type , Address , Length , Scan_Interval
CMD_AO_01 , DA1 ,0 , RDBC , ModbusDevice2 , Reg_Bytes ,0 , 40 , 1.000s
CMD_AO_02 , DA2 ,0 , RDBC , ModbusDevice2 , Input_Reg_Bytes , 0 , 40 , 1.000s
CMD_AI_01 , DA3 ,0 , RDBC , ModbusDevice2 , Reg_Bytes ,0 , 320 , 1.000s
CMD_AI_02 , DA4 ,0 , RDBC , ModbusDevice2 , Input_Reg_Bytes , 0 , 320 , 1.000s

Each Map Descriptor will read 20 registers and store them as 40 bytes or 320 bits.

7.4 Reading Data Types

7.4.1 32-Bit Integer and Float Data Types


When a Modbus slave device needs to pass a 32-Bit Integer or a 32-Bit Float, it splits the float into two 16-
bit Integers and maps it to consecutive registers. The following data types read the 2 consecutive registers
and auto combines them into a 32-Bit Integer or Float before storing it in a Data Array.
• Float_Reg (32-Bit IEEE 754 Floating Point in Holding Register FC03)
• 32Bit_Reg (32-Bit Integer in Holding Register FC03)
• Input_Float (32-Bit IEEE 754 Floating Point in Input Register FC04)
• Input_Reg_32Bit (32-Bit Integer in Input Register FC04)
• Float_Reg_Swap (32-Bit IEEE 754 Floating Point with swapped format in Holding Register FC03)
• 32Bit_Reg_Swap (32-Bit Integer with swapped format in Holding Register FC03)
• Input_Float_Swap (32-Bit IEEE 754 Floating Point with swapped format in Input Register FC04)
• Input_Reg_32Bit_Swap (32-Bit Integer with swapped format in Input Register FC04)
Example
Data_Arrays
Data_Array_Name , Data_Format , Data_Array_Length
DA_U32_01 , Uint32 , 20
DA_FLT_01 , Float , 20

Modbus TCP/IP Driver Manual 18


Additional Information

Accessing Priority Array Information


The Priority Array table and its “In_Use” (or Not Relinquished) state are stored internally to every Map
Descriptor and cannot be accessed directly. The information can be accessed indirectly by specifying the
following Data Arrays which will maintain an exact copy of the Priority Array Table for the Map Descriptor.
Section Title
Map_Descriptors
Column Title Function Legal Values
Name of Data Array where the Priority Array Table will be
Up to 16
stored. Location 0 is the Relinquish Default value and
DA_Pri_Array alphanumeric
locations 1 to 16 the different entries of the Priority Array
characters
Table.
DA_Pri_Array_Offset* Starting location in Data Array. 1-65535, 0
Name of Data Array that indicates if a specific Priority Value
Up to 16
is in use. Location 0 indicates whether the Relinquish
DA_Pri_In_Use alphanumeric
Default has been set and locations 1 to 16 indicate whether
characters
the index is in use (1), or Relinquished (0).
DA_Pri_In_Use_Offset* Starting location in Data Array. 1-65535, 0

// Analog Output Map_Descriptor for testing Priority Arrays

Map_Descriptors
Map_Descriptor_Name , Data_Type , Object_ID , Function , Data_Array_Name , Data_Array_Index , Node_Name , Length
CMD_AOP_1 , AO ,1 , Passive , DA_OUT ,0 , N1 11 ,1

, Relinquish_default , DA_Pri_Array , DA_Pri_Array_Offset , DA_Pri_In_Use , DA_Pri_In_Use_Offset


, 40.56 , DA_Pri_Array_1 ,0 , DA_Pri_in_use_1 ,0

7.4.2 Relinquishing Control of a Point as a Client


It is possible to relinquish control of a point by writing a null to the correct priority level. The following
example illustrates how this is done.
Map_Descriptors
Map_Descriptor_Name , Data_Type , Function , Scan_Interval , Data_Array_Name , Data_Array_Index
CMD AO , AO , Rdbc , 1.0s , DA AO ,2
CMD AO Rel , AO , Wrbx , 1.0s , DA AO ,3

, Node_Name , Address , Length , Write_Priority , Service


, N1 1 ,1 ,1 ,7 ,-
, N1 1 ,1 ,1 ,7 , Relinquish

In the above example:


• Map_Descriptor_Name CMD AO is a Read Map Descriptor that will write at priority 7 if a write-
through occurs.
• Map_Descriptor_Name CMD AO Rel is a Write-on-Change Map Descriptor that will write a NULL
at priority 7 (i.e. release Priority Array entry 7) when a write occurs.
• Address parameter length must be 1 as shown above.
//Client Side Map Descriptors

Map_Descriptors
Map_Descriptor_Name , Data_Array_Name , Data_Array_Offset , Function , Node_Name , Data_Type , Address , Length , Scan_Interval
CMD_01 , DA_FLT_01 ,0 , RDBC , Dev_01 , Float_Reg , 40001 ,1 , 0.000s
CMD_02 , DA_U32_01 ,0 , RDBC , Dev_01 , 32Bit_Reg , 40003 ,1 , 0.000s
CMD_03 , DA_FLT_01 ,1 , RDBC , Dev_01 , Input_Float , 30001 ,1 , 0.000s
CMD_04 , DA_U32_01 ,1 , RDBC , Dev_01 , Input_Reg_32Bit , 30003 ,1 , 0.000s
CMD_05 , DA_FLT_01 ,2 , RDBC , Dev_01 , Float_Reg_Swap , 40005 ,1 , 0.000s
CMD_06 , DA_U32_01 ,2 , RDBC , Dev_01 , 32Bit_Reg_Swap , 40007 ,1 , 0.000s
CMD_07 , DA_FLT_01 ,3 , RDBC , Dev_01 , Input_Float_Swap , 30005 ,1 , 0.000s
CMD_08 , DA_U32_01 ,3 , RDBC , Dev_01 , Input_Reg_32Bit_Swap , 30007 ,1 , 0.000s

Modbus TCP/IP Driver Manual 19


Additional Information

7.4.3 64-Bit Integer and Float Data Types


When a Modbus slave device needs to pass a 64-Bit Integer or a 64-Bit Float, it splits the float into four 16-
bit Integers and maps it to consecutive registers. The following data types read the 4 consecutive registers
and auto combines them into a 64-Bit Integer or Float, before the scaling is applied (to keep the decimal
precision) and stores the scaled value in a Data Array. When serving the value to the output protocol, the
reverse scaling needs to be applied.
• 64Bit_Reg (64-Bit Integer in Holding Register FC03)
• Double_Reg (64-Bit IEEE 754 Floating Point in Holding Register FC03)
• Input_Reg_64bit (64-Bit Integer in Input Register FC04)
• Input_Double (64-Bit IEEE 754 Floating Point in Input Register FC04)
Example
Data_Arrays
Data_Array_Name , Data_Format , Data_Array_Length
DA_U32_01 , Uint32 , 20
DA_FLT_01 , Float , 20

//Client Side Map Descriptors ,

, Map_Descriptors
, Map_Descriptor_Name , Data_Array_Name , Data_Array_Offset , Function , Node_Name , Data_Type , Address , Length , Scan_Interval
, CMD_01 , DA_U32_01 ,0 , RDBC , Dev_01 , 64Bit_Reg , 40001 ,1 , 0.000s
, CMD_02 , DA_FLT_01 ,0 , RDBC , Dev_01 , Double_Reg , 40003 ,1 , 0.000s
, CMD_03 , DA_U32_01 ,1 , RDBC , Dev_01 , Input_Reg_64bit , 30001 ,1 , 0.000s
, CMD_04 , DA_FLT_01 ,1 , RDBC , Dev_01 , Input_Double , 30003 ,1 , 0.000s

, Data_Array_Low_Scale , Data_Array_High_Scale , Node_Low_Scale , Node_High_Scale


,0 ,1 ,0 , 1000000000
,0 ,1 ,0 , 1000000000
,0 ,1 ,0 , 1000000000
,0 ,1 ,0 , 1000000000

Nodes
Node_Name , Node_ID , Protocol
Virtual_Dev_11 , 11 , Bacnet_IP

//Client Side Map Descriptors

, Map_Descriptors
, Map_Descriptor_Name , Data_Array_Name , Data_Array_Offset , Function , Node_Name , Object Type , Object Instance
, SMD_11_AI_01 , DA_U32_01 ,0 , Passive , Virtual_Dev_11 , AI ,1
, SMD_11_AI_02 , DA_FLT_01 ,0 , Passive , Virtual_Dev_11 , AI ,2
, SMD_11_AI_03 , DA_U32_01 ,1 , Passive , Virtual_Dev_11 , AI ,3
, SMD_11_AI_04 , DA_FLT_01 ,1 , Passive , Virtual_Dev_11 , AI ,4

, Data_Array_Low_Scale , Data_Array_High_Scale , Node_Low_Scale , Node_High_Scale


,0 ,1 ,0 , 1000000000
,0 ,1 ,0 , 1000000000
,0 ,1 ,0 , 1000000000
,0 ,1 ,0 , 1000000000

Modbus TCP/IP Driver Manual 20


Additional Information

7.5 Reading Device Identification

7.5.1 Client Side Map Descriptor


There could be various objects describing device identification. Each object has its own ID (0-255). Only
the first 7 ID’s (0-6) objects are defined and are ASCII Strings.
Object ID Object Name
0 VendorName
1 ProductCode
2 MajorMinorRevision
3 VendorUrl
4 ProductName
5 ModelName
6 UserApplicationName
The Client Side Map Descriptors read the specified object from a remote device. They will store the object
data character-by-character in the specified data array, up to the limit specified by the Map Descriptor
length.
Any object could have up to 248 characters.
//Client Side Map Descriptors
Map_Descriptors
Map_Descriptor_Name , Data_Array_Name , Data_Array_Offset , Function , Node_Name , Data_Type , Address , Length
CMD_Vendor_name , DA_Vendor ,0 , Server , PLC_01 , Device_Id ,0 , 248
CMD_Product_code , DA_Prodcode ,0 , Server , PLC_01 , Device_Id ,1 , 248

7.5.2 Server Side Map Descriptor


Server Side Map Descriptors can define any object as shown below. The Driver will serve strings from the
data array as an object value. The string from the data array is considered complete if the character is 0
(null) or if all characters are fetched as per the Map Descriptor length.
If the first character is 0 (null) then the single character '-' will be used as the object value.
//Server Side Map Descriptors
Map_Descriptors
Map_Descriptor_Name , Data_Array_Name , Data_Array_Offset , Function , Node_Name , Data_Type , Address , Length
CMD_Vendor_name , DA_Vendor ,0 , Server , PLC_01 , Device_Id ,0 , 248
CMD_Product_code , DA_Prodcode ,0 , Server , PLC_01 , Device_Id ,1 , 248

7.6 Broadcasting Write Messages


Standard Modbus TCP/IP node addresses range from 1 to 254, with 0 being reserved for broadcast
messages. Setting the Node ID to 0 allows write messages to be broadcast to all configured slave devices.
To perform a valid broadcast, the node ID will need to be set to 0 and the map-descriptor function will need
to be set to a write.
Example
// Client Side Nodes
Nodes
Node_Name , Node_ID , Protocol , Port , Address_Type
BROADCAST_NODE ,0 , Modbus/TCP , R2 , PDU

//Client Side Map Descriptors


Map_Descriptors
Map_Descriptor_Name , Data_Array_Name , Data_Array_Offset , Function , Node_Name , Data_Type , Address , Length , Scan_Interval
CMD_AO_01 , DA1 ,0 , RDBC , ModbusDevice2 , Reg_Bytes ,0 , 40 , 1.000s
CMD_AO_02 , DA2 ,0 , RDBC , ModbusDevice2 , Input_Reg_Bytes , 0 , 40 , 1.000s

Modbus TCP/IP Driver Manual 21


Additional Information

7.7 Reading Scattered Addresses


This function enables the user to read non-contiguous registers. It also avoids multiple polls using function
3 or 4 to read non-contiguous registers.
The following is an example to show the request and response to read input registers (sub function 0x04)
101 (0x65), 114 (0x72) and 149 (0x95) from Slave_ID 33 (0x21).
Poll request example:
Parameter Value
Modbus slave address 0x21
Function code 0x64
Data length in bytes 0x06
Sub-function code 0x04 (0x03 to read holding registers)
Transmission number 0xXX
Address of 1st word to read (MSB) 0x00
Address of 1st word to read (LSB) 0x65
Address of 2nd word to read (MSB) 0x00
Address of 2nd word to read (LSB) 0x72
Address of 3rd word to read (MSB) 0x00
Address of 3rd word to read (LSB) 0x95
CRC MSB 0xXX
CRC LSB 0xXX
Suppose the value of register 101 is 3000, register 114 is 6000 and register 149 is 9000. The
following would be the response from the slave:
Parameter Value
Modbus slave address 0x21
Function code 0x64
Data length in bytes 0x06
Sub-function code 0x04 (same as in request)
Transmission number 0xXX (same as in request)
1st register value (MSB) 0x0B
1st register value (LSB) 0xB8
2nd register value (MSB) 0x17
2nd register value (LSB) 0x70
3rd register value (MSB) 0x23
3rd register value (LSB) 0x28
CRC MSB 0xXX
CRC LSB 0xXX
Following is the corresponding Client Map Descriptor example, it will read 3 scattered addresses and will
store in data array DA_AI_01 at offset 0, 1 and 2.
//Client Side Map Descriptors
Map_Descriptors
Map_Descriptor_Name , Data_Array_Name , Data_Array_Offset , Function , Node_Name , Address , Length , Scattered_Addresses
CMD_Scattered_Read , DA_AI_01 ,0 , RDBC , PLC_33 , 30102 ,3 , "30115 30150"

On the server side, no configuration changes are required to support the scattered read function. Ensure
that all registers are configured. Registers can be configured in a single Server Map Descriptor range or
scattered over multiple Server Map Descriptors.

Modbus TCP/IP Driver Manual 22


Additional Information

8 Troubleshooting

8.1 Server Configuration of System Station Address


When using the FieldServer as a Modbus Server, the FieldServer System Station address must be
configured to be different from any of the configured Modbus Server Node_ID’s. Configuring these to be
the same invokes proprietary system information to be transmitted and should therefore be avoided.

8.2 Modbus TCP/IP Connection Error Descriptions


No Start – An Ethernet connection cannot be established to the specified IP Address.
TCP Connection Lost – An Ethernet connection was established to the specified IP Address but the
connection was terminated or lost.
Timeout – An Ethernet connection was established to the specified IP Address and a Modbus request was
sent but the device did not respond before the timeout interval expired.

8.3 Understanding Max Concurrent Message s


The FieldServer Max_Concurrent_Messages parameter enables polling multiple “threads” for the Modbus
TCP/IP Driver; increasing network communications speed if the FieldServer is a Modbus Master. This
feature can significantly improve communication speeds but may also create minor communication errors
with other vendors’ devices. Most often, this does not prevent communication but creates a small
percentage of communication errors. These errors must be accepted to utilize this feature.
Consider an application where one communication thread is used to poll four devices. This sequence
includes the following steps:
1. Poll device 1 and wait for a response to be received.
2. Poll device 2 and wait for a response to be received.
3. Poll device 3 and wait for a response to be received.
4. Poll device 4 and wait for a response to be received.
5. Poll device 5 and wait for a response, then go back to step 1.
Now consider five threads for the communication. Then the sequence follows:
1. Poll devices 1,2,3,4 and 5 at the same time and wait for the individual responses to come back.
2. As each thread is freed up, poll the next device in line and continue.
This example shows how using multiple threads is substantially faster but additionally, if one of the devices
is faulty then the network is influenced far less when five threads are used.
• In the single thread scenario, communication must wait for the faulty device and when it doesn’t
respond (after 2 seconds) it moves on. This is a significant delay.
• In the five thread scenario, only one thread waits while the other threads communicate freely.

Modbus TCP/IP Driver Manual 23


Additional Information

A typical Modbus slave device should be able to handle multiple thread situations. However, it is common
practice to request multiple mappings (register sets) from each device, and each mapping represents a
poll. With one thread, a request for multiple mappings from the same device at the same time is not possible,
but with multiple threads this situation can occur. Because this is not a common scenario, individual vendor
devices respond to this situation differently and may not respond at all when given a multiple request. If this
happens, the FieldServer logs errors and no communication occurs, but when the FieldServer polls the
same device a bit later and there is no second poll request active the response will succeed. Therefore,
device communication is still intact and these errors represent no significant problem.
In Summary, although setting Max_Concurrent_Messages >1 causes errors in communication, these errors
are often not serious and the benefits of Multi-threading are great enough to tolerate the errors.
It is recommended to start testing around a value of 5 to determine the best setting for this parameter.
Increasing the parameter increases communication speed but may also increase errors significantly.
Setting the parameter to 1, switches multi-threading off and eliminates all errors caused by the feature.
Using this parameter is highly recommended in all applications where speed is a critical factor.

8.4 Error: MB_TCP : Response Failed in mod_build


This error can occur in the Gateway when the driver is configured as a Server, and an external Modbus
TCP Master sends a poll for a register that is not listed in the Server Side Map Descriptors.
Normally the Modbus TCP driver will send an Exception Response but in some cases it will not, and this
error will be logged in the Gateway.
To resolve this error, check the Modbus Registers the Modbus TCP Master is attempting to poll from the
Gateway and remove any registers from the Modbus TCP Master that is not configured in the Server Side
Map Descriptors.

Modbus TCP/IP Driver Manual 24


Additional Information

9 Reference

9.1 Data Types


If Node parameter Address_Type is set as ADU or PDU, then Data_Type must be specified as follows.
Address_Type ADU:
Address range Data_Type Function Code (Write) Function Code (Read)
1 – 65536 Coil 15 1
1 – 65536 Discrete_Input n/a. 2
1 – 65536 Input_Register n/a. 4
1 – 65536 Holding_Register 16 3
Address_Type PDU:
Address range Data_Type Function Code (Write) Function Code (Read)
0 – 65535 FC01 15 1
0 – 65535 FC02 n/a. 2
0 – 65535 FC04 n/a. 4
0 – 65535 FC03 16 3

Address_Type Modicon_5digit:
When a Modbus address range is specified, a particular Data Type is implied (defaults shown below).
Address range Data_Type Function Code (Write) Function Code (Read)
00001 – 09999 Coil 5,15 1
10001 – 19999 Discrete_Input n/a. 2
30001 – 39999 Input_Register n/a. 4
40001 – 49999 Holding_Register 6,16 3

9.2 Single Writes


If writing multiple registers, the write function will 16.
If writing multiple coils, the write function will 15.
If writing a single register, the write function will be 6 unless Write_FNC parameter is set to “Multiple”.
If writing a single coil, the write function will be 5 unless Write_FNC parameter is set to “Multiple”.

9.3 Driver Error Messages


Message Description/Action
MB_TCP:#01 FYI. Server This message is printed when the TCP frame contains more bytes than a
response extra bytes single Modbus_TCP message but insufficient extra bytes to form a second
ignored. Cnt=%d %#x complete Modbus message. There is no explanation for the 'padding' bytes,
MB_TCP:#02 FYI. Master but since the Driver ignores the extra bytes and processes the complete
poll extra bytes ignored. message correctly, the message can be ignored. The driver prints this
Cnt=%d %#x message once. It is suppressed on subsequent occurrences.
The driver has detected enough bytes in the TCP frame for two complete
MB_TCP:#03 Err. TCP
Modbus_TCP messages. The second message is ignored. If this is a
Frame has multiple
problem, re-configure the remote node so that only one Modbus_TCP
MB_TCP messages.
message is contained in a single TCP frame. The driver prints this message
Ignored 2nd
once. It is suppressed on subsequent occurrences.

Modbus TCP/IP Driver Manual 25

You might also like