FS-8704-03 ModbusTCP
A Sierra Monitor Company
Driver Manual
(Supplement to the FieldServer Instruction Manual)
FS-8704-03 ModbusTCP
APPLICABILITY & EFFECTIVITY
Effective for all systems manufactured after January 2013
Driver Version:
Document Revision:
1.05
4
FS-8704-03 Modbus TCP Driver Manual
Table of Contents
TABLE OF CONTENTS
1
Modbus/TCP Description ............................................................................................................................... 3
2
Driver Scope of Supply ................................................................................................................................... 3
2.1
Supplied by FieldServer Technologies for this Driver ...................................................................................3
rd
2.2
Provided by Supplier of 3 Party Equipment ...............................................................................................3
3
Hardware Connections ................................................................................................................................... 4
4
Data Array Parameters ................................................................................................................................... 5
5
Configuring the FieldServer as a Modbus/TCP Client...................................................................................... 6
5.1
Client Side Connection Parameters ..............................................................................................................6
5.2
Client Side Node Parameters .......................................................................................................................7
5.3
Client Side Map Descriptor Parameters .......................................................................................................8
5.3.1 FieldServer Related Map Descriptor Parameters .....................................................................................8
5.3.2 Driver Related Map Descriptor Parameters .............................................................................................8
5.3.3 Timing Parameters ...................................................................................................................................9
5.3.4 Map Descriptor Example. .......................................................................................................................10
6
Configuring the FieldServer as a Modbus/TCP Server ................................................................................... 11
6.1
Server Side Connection Parameters ...........................................................................................................11
6.2
Server Side Node Parameters ....................................................................................................................12
6.3
Server Side Map Descriptor Parameters ....................................................................................................12
6.3.1 FieldServer Specific Map Descriptor Parameters ...................................................................................12
6.3.2 Driver Specific Map Descriptor Parameters ...........................................................................................13
6.3.3 Map Descriptor Examples ......................................................................................................................14
Appendix A. Useful Features ................................................................................................................................ 15
Appendix A.1. Managing Floating points with Modbus ...........................................................................................15
Appendix A.1.1. Transferring non-integer values with one register .................................................................15
Appendix A.1.2. Transferring Float/32 bit values with two registers ...............................................................16
Appendix A.2. Node_Offline_Response...................................................................................................................16
Appendix B. Troubleshooting............................................................................................................................... 18
Appendix B.1. Server Configuration of System Station Address..............................................................................18
Appendix C. Reference......................................................................................................................................... 19
Appendix C.1. Data Types ........................................................................................................................................19
Appendix C.1.1. For Address_Type ADU : .........................................................................................................19
Appendix C.1.2. For Address_Type PDU : .........................................................................................................19
Appendix C.1.3. For Address_Type Modicon_5digit .........................................................................................19
Appendix C.2. Read/write Operation ......................................................................................................................19
Appendix C.3. Driver Error Messages ......................................................................................................................20
FieldServer Technologies 1991 Tarob Court Milpitas, California 95035 USA Web: www.fieldserver.com
Tel: (408) 262 2299 Fax: (408) 262 2269 Toll Free: (888) 509 1970 email: support@fieldserver.com
FS-8704-03 Modbus TCP Driver Manual
1
Page 3 of 20
MODBUS/TCP DESCRIPTION
The Modbus TCP Driver allow the FieldServer to transfer data to and from devices over Ethernet using Modbus TCP
Protocol. The Modbus TCP driver uses port 502 and this port 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.
FieldServer uses the following three Models
To cover all these 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.
The key difference between ADU and PDU is for example 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 1: If 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 2: 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 Supplied by FieldServer Technologies for this Driver
FieldServer Technologies PART #
FS-8915-10
Description
1
UTP cable (7 foot) for Ethernet connection
2.2 Provided by Supplier of 3 rd Party Equipment
Part #
1
2
3
Description
2
Modbus/TCP Server, e.g. Quantum PLC
Modbus/TCP Host Node, e.g. Intellution Fix, Wondereware Intouch, GE Cimplicity, Quantum PLC
3
(Master).
This cable is necessary for connection to the driver. It is shipped with the FieldServer and not separately with the driver.
If FieldServer used as Modbus/TCP Client.
If FieldServer used as Modbus/TCP Server
FieldServer Technologies 1991 Tarob Court Milpitas, California 95035 USA Web: www.fieldserver.com
Tel: (408) 262 2299 Fax: (408) 262 2269 Toll Free: (888) 509 1970 email: support@fieldserver.com
FS-8704-03 Modbus TCP Driver Manual
3
Page 4 of 20
HARDWARE CONNECTIONS
Configure the PLC according to manufacturer’s instructions.
Remote Modbus
Device
Hub/Router
FieldServer Part #
8915-10
UTP cable
Connect to an Ethernet Port
on the FieldServer
8
1
FieldServer
N1
FieldServer Technologies 1991 Tarob Court Milpitas, California 95035 USA Web: www.fieldserver.com
Tel: (408) 262 2299 Fax: (408) 262 2269 Toll Free: (888) 509 1970 email: support@fieldserver.com
FS-8704-03 Modbus TCP Driver Manual
4
Page 5 of 20
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
Data_Array_Name
Provide name for Data Array
Data_Array_Format
Provide data format. Each Data Array can only take on one
format.
UINT 16, UINT 32, SINT 16,
SINT 32, BIT, FLOAT
Data_Array_Length
Number of Data Objects. Must be larger than the data
storage area required by the Map Descriptors for the data
being placed in this array.
1 – 255
Legal Values
Up to 15 alphanumeric
characters
Example
// Data Arrays
Data_Arrays
Data_Array_Name
DA_AI_01
DA_AO_01
DA_DI_01
DA_DO_01
, Data_Array_Format
, Float
, Float
, Bit
, Bit
, Data_Array_Length
, 200
, 200
, 200
, 200
FieldServer Technologies 1991 Tarob Court Milpitas, California 95035 USA Web: www.fieldserver.com
Tel: (408) 262 2299 Fax: (408) 262 2269 Toll Free: (888) 509 1970 email: support@fieldserver.com
FS-8704-03 Modbus TCP Driver Manual
5
Page 6 of 20
CONFIGURING THE FIELDSERVER AS A MODBUS/TCP CLIENT
For a detailed discussion on FieldServer configuration, please 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 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 communications, 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 Servers needs to be mapped in the “Client Side Map Descriptors” section.
Details on how to do this can be found below.
Note that * indicates an optional parameter, with the bold legal value being the default.
5.1 Client Side Connection Parameters
Section Title
Connections
Column Title
Adapter
Protocol
Poll Delay*
Function
Specify which adapter this protocol uses
Specify protocol used
Time interval between polls
Legal Values
N1
Modbus/TCP
0-32000 s, 0.05 s.
Example:
// Client Side Connections
Connections
Adapter
N1
, Protocol
, Modbus/TCP
, Poll_Delay
, 0.05s
FieldServer Technologies 1991 Tarob Court Milpitas, California 95035 USA Web: www.fieldserver.com
Tel: (408) 262 2299 Fax: (408) 262 2269 Toll Free: (888) 509 1970 email: support@fieldserver.com
FS-8704-03 Modbus TCP Driver Manual
Page 7 of 20
5.2 Client Side Node Parameters
Section Title
Nodes
Column Title
Function
Node_Name
Provide name for Node
Node_ID
Protocol
Adapter
Station Address of Remote Server Node
Specify protocol used
Specify which adapter this protocol uses
IP_address
IP address of client PLC
Address_Type
4
Modbus_TCP_IP_Port*
Write_Fnc*
Write_Length*
Specify Register Mapping Model
Select remote Internet Protocol Port
Set to Multiple if Remote Server Node only supports Write
Multiple function code 15 & 16
Set to Map Descriptor Length if write-thru operation should
write all registers as specified by Map Descriptor length.
By default write-thru writes a single register.
If Write_Length also specified on Map Descriptor, Map
Descriptor’s parameter will be used.
// Client Side Nodes
Nodes
Node_Name
, Node_ID
Modbus device 3 , 3
Multiple, -,
Map Descriptor Length,
-, 1,
For new devices where
65536 registers could be
available in each memory
area
Example
// Client Side Nodes
Nodes
Node_Name
, Node_ID
Modbus device 1 , 1
Modbus device 2 , 2
Legal Values
Up to 32 alphanumeric
characters
1 – 255
Modbus/TCP
N1
Valid IP address, e.g.
192.168.1.13
ADU,PDU,
Modicon_5digit
1-65534, 502
, Protocol
, Modbus/TCP
, Modbus/TCP
, Protocol
, Modbus/TCP
, Adapter
, N1
, N1
, Adapter
, N1
, Address_Type
, ADU
, PDU
, IP_Address
, 192.168.1.172
, IP_Address
, 192.168.1.172
, 192.168.1.172
For devices where only
9999 registers could be
available in each memory
area
4 Optional for Modicon 5 digit devices
FieldServer Technologies 1991 Tarob Court Milpitas, California 95035 USA Web: www.fieldserver.com
Tel: (408) 262 2299 Fax: (408) 262 2269 Toll Free: (888) 509 1970 email: support@fieldserver.com
FS-8704-03 Modbus TCP Driver Manual
Page 8 of 20
5.3 Client Side Map Descriptor Parameters
5.3.1 FieldServer Related Map Descriptor Parameters
Column Title
Map_Descriptor_Name
Data_Array_Name
Function
Name of this Map Descriptor
Dame of Data Array where data is to be
stored in the FieldServer
Data_Array_Offset
Starting location in Data Array
Function
Function of Client Map Descriptor
Legal Values
Up to 32 alphanumeric characters
One of the Data Array names from
Section 4
0 to (Data_Array_Length -1) as specified
in Section 4
Rdbc, Wrbc, Wrbx, Passive
5.3.2 Driver Related Map Descriptor Parameters
Column Title
Function
Node_Name
Name of Node to fetch data from
Data_Type
5
Address
Starting address of read block
Length
Length in items to record from PLC
Set to Map Descriptor Length if write-thru
operation should write all registers as
specified by Map Descriptor length.
By default write-thru writes a single register.
If Write_Length also specified on Map
Descriptor, Map Descriptor’s parameter will
be used.
Write_Length*
5
Specify memory area. Refer to Appendix
A.1.2 on how to transfer 32 Bit values using
Modbus registers.
Legal Values
One of the Node names specified in
Section 0
Address_Type = ADU
Coil, Discrete_Input, Input_Register,
Holding_Register,
Single_Coil,
Single_Register
Address_Type = PDU
FC01, FC02, FC03, FC04,
FC05, FC06, FC15, FC16
Address_Type = Modicon_5digit
- (Dash), Single_Register, Single_Coil
Address_Type = ADU
1-65536
Address_Type = PDU
0-65535
Address_Type = Modicon_5digit
40001, 30001, etc
All Address_Type
Float_Reg, 32-Bit_Reg, Input_Float,
Input_Reg_32Bit
1 – 125 (depending on type)
Map Descriptor Length, -, 1,
Optional only for Modicon_5digit addressing, and only if Single writes do not need to be forced
FieldServer Technologies 1991 Tarob Court Milpitas, California 95035 USA Web: www.fieldserver.com
Tel: (408) 262 2299 Fax: (408) 262 2269 Toll Free: (888) 509 1970 email: support@fieldserver.com
FS-8704-03 Modbus TCP Driver Manual
Data_Array_Low_Scale*
Scaling zero in Data Array
Data_Array_High_Scale*
Scaling max in Data Array
Node_Low_Scale*
Scaling zero in Connected Node
Node_High_Scale*
Scaling max in Connected Node
Page 9 of 20
Any signed 32 bit integer in the
range:
-2,147,483,648 to 2,147,483,647. 0
Any signed 32 bit integer in the
range:
-2,147,483,648 to 2,147,483,647. 100
Any signed 32 bit integer in the
range:
-2,147,483,648 to 2,147,483,647. 0
Any signed 32 bit integer in the
range:
-2,147,483,648 to 2,147,483,647. 100
5.3.3 Timing Parameters
Column Title
Scan_Interval*
Function
Seconds per Scan
Legal Values
0-32000, 20
FieldServer Technologies 1991 Tarob Court Milpitas, California 95035 USA Web: www.fieldserver.com
Tel: (408) 262 2299 Fax: (408) 262 2269 Toll Free: (888) 509 1970 email: support@fieldserver.com
FS-8704-03 Modbus TCP Driver Manual
Page 10 of 20
5.3.4 Map Descriptor Example.
// Client Side Map Descriptors
// Note: All three examples below are addressing the same Modbus registers.
// For Nodes where Address_Type is ADU
Map_Descriptors
Map_Descriptor_Name , Data_Array_Name
CMD_AI_01
, DA_AI_01
CMD_AO_01
, DA_AO_01
CMD_DI_01
, DA_DI_01
CMD_DO_01
, DA_DO_01
, Data_Array_Offset
,0
,0
,0
,0
, Function
, Rdbc
, Rdbc
, Rdbc
, Rdbc
, Node_Name
, MODBUS DEVICE1
, MODBUS DEVICE1
, MODBUS DEVICE1
, MODBUS DEVICE1
, Data_Type
, Input_Register
, Holding_Register
, Discrete_Input
, Coil
, Address
,1
,1
,1
,1
, Length
, 20
, 20
, 20
, 20
, Scan_Interval
, 1.000s
, 1.000s
, 1.000s
, 1.000s
// For Nodes where Address_Type is PDU
Map_Descriptors
Map_Descriptor_Name , Data_Array_Name
CMD_AI_02
, DA_AI_02
CMD_AO_02
, DA_AO_02
CMD_DI_02
, DA_DI_02
CMD_DO_02
, DA_DO_02
, Data_Array_Offset
,0
,0
,0
,0
, Function
, Rdbc
, Rdbc
, Rdbc
, Rdbc
, Node_Name
, MODBUS DEVICE2
, MODBUS DEVICE2
, MODBUS DEVICE2
, MODBUS DEVICE2
, Data_Type
, FC04
, FC03
, FC02
, FC01
, Address
,0
,0
,0
,0
, Length
, 20
, 20
, 20
, 20
, Scan_Interval
, 1.000s
, 1.000s
, 1.000s
, 1.000s
// For Nodes where Address_Type is Modicon_5digit.
Map_Descriptors
Map_Descriptor_Name , Data_Array_Name , Data_Array_Offset
CMD_AI_03
, DA_AI_03
,0
CMD_AO_03
, DA_AO_03
,0
CMD_DI_03
, DA_DI_03
,0
CMD_DO_03
, DA_DO_03
,0
, Function
, Rdbc
, Rdbc
, Rdbc
, Rdbc
, Node_Name
, MODBUS DEVICE3
, MODBUS DEVICE3
, MODBUS DEVICE3
, MODBUS DEVICE3
, Address
, 30001
, 40001
, 10001
, 00001
, Length
, 20
, 20
, 20
, 20
, Scan_Interval
, 1.000s
, 1.000s
, 1.000s
, 1.000s
FieldServer Technologies 1991 Tarob Court Milpitas, California 95035 USA Web: www.fieldserver.com
Tel: (408) 262 2299 Fax: (408) 262 2269 Toll Free: (888) 509 1970 email: support@fieldserver.com
FS-8704-03 Modbus TCP Driver Manual
6
Page 11 of 20
CONFIGURING THE FIELDSERVER AS A MODBUS/TCP SERVER
For a detailed discussion on FieldServer configuration, please 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 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 communications, the driver independent FieldServer buffers need to be declared
in the “Data Arrays” section, the FieldServer virtual Node(s) needs to be declared in the “Server Side Nodes”
section, and the data to be provided to the clients needs to be mapped in the “Server Side Map Descriptors”
section. Details on how to do this can be found below.
Note that in the tables, * indicates an optional parameter, with the bold legal value being the default.
6.1 Server Side Connection Parameters
Section Title
Connections
Column Title
Adapter
IP_Port
Protocol
Function
Specify which adapter this protocol uses.
Specify internet protocol Port
Specify protocol used
Legal Values
N1
1-65534
Modbus/TCP
Example:
// Server Side Connections
Connections
Adapter
N1
, Protocol
, Modbus/TCP
FieldServer Technologies 1991 Tarob Court Milpitas, California 95035 USA Web: www.fieldserver.com
Tel: (408) 262 2299 Fax: (408) 262 2269 Toll Free: (888) 509 1970 email: support@fieldserver.com
FS-8704-03 Modbus TCP Driver Manual
Page 12 of 20
6.2 Server Side Node Parameters
Section Title
Nodes
Column Title
Function
Node_Name
Provide name for node
Node_ID
Protocol
Node ID of physical server node
Specify protocol used
Address_Type*
6
Node_Offline_Response*
Specify Register Mapping Model
Set the FieldServer response to the Modbus TCP
Client when the Server Node supplying the data has
gone offline
Legal Values
Up to 32 alphanumeric
characters
1 – 255 (Optional)
Modbus/TCP
ADU,PDU,
Modicon_5digit
No_Response,
Old_Data,
Zero_Data,
FFFF_Data,
Refer to Appendix A.1
Note that 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 devices where 65536 addresses are available in each memory area.
Nodes
Node_Name
, Node_ID
, Protocol
MB_Srv_11
, 11
, Modbus/TCP
MB_Srv_12
, 12
, Modbus/TCP
// For devices where only 9999 registers are available in each memory area.
Nodes
MB_Srv_13
, 13
, Modbus/TCP
MB_Srv_14
, 14
, Modbus/TCP
, Address_Type
, ADU
, PDU
, Modicon_5digit
,-
6.3 Server Side Map Descriptor Parameters
6.3.1 FieldServer Specific Map Descriptor Parameters
Column Title
Map_Descriptor_Name
Data_Array_Name
6
Function
Name of this Map Descriptor
Dame of Data Array where data is to be
stored in the FieldServer
Data_Array_Offset
Starting location in Data Array
Function
Function of Client Map Descriptor
Legal Values
Up to 32 alphanumeric characters
One of the Data Array names from
Section 4.
0 to (Data_Array_Length 1-1) as
specified in Section 4.
Passive
Optional for Modicon 5 digit devices
FieldServer Technologies 1991 Tarob Court Milpitas, California 95035 USA Web: www.fieldserver.com
Tel: (408) 262 2299 Fax: (408) 262 2269 Toll Free: (888) 509 1970 email: support@fieldserver.com
FS-8704-03 Modbus TCP Driver Manual
Page 13 of 20
6.3.2 Driver Specific Map Descriptor Parameters
Column Title
Node_Name
Data_Type
7
7
Function
Name of Node this Map
description is associated with
Specify memory area
Length
Length of Map Descriptor
Address
Starting address of read block
Data_Array_Low_Scale*
Scaling zero in Data Array
Data_Array_High_Scale*
Scaling max in Data Array
Node_Low_Scale*
Scaling zero in Connected Node
Node_High_Scale*
Scaling max in Connected Node
Legal Values
One of the node names specified in “Node_Name”
above
Address_Type = ADU
Coil,
Discrete_Input,
Input_Register,
Holding_Register, Single_Coil, Single_Register
Address_Type = PDU
FC01, FC02, FC03, FC04,
FC05, FC06, FC15, FC16
Address_Type = Modicon_5digit
- (Dash), Single_Register, Single_Coil
Address_Type = ADU
1-65535
Address_Type = PDU
1-65535
Address_Type = Modicon_5digit
1-9999
Address_Type = ADU
1-65536
Address_Type = PDU
0-65535
Address_Type = Modicon_5digit
40001, 30001, etc
Any signed 32 bit integer in the range: 2,147,483,648 to 2,147,483,647, 0
Any signed 32 bit integer in the range:
-2,147,483,648 to 2,147,483,647, 100
Any signed 32 bit integer in the range: 2,147,483,648 to 2,147,483,647, 0
Any signed 32 bit integer in the range: 2,147,483,648 to 2,147,483,647, 100
Optional only for Modicon_5digit addressing, and only if Single writes do not need to be forced
FieldServer Technologies 1991 Tarob Court Milpitas, California 95035 USA Web: www.fieldserver.com
Tel: (408) 262 2299 Fax: (408) 262 2269 Toll Free: (888) 509 1970 email: support@fieldserver.com
FS-8704-03 Modbus TCP Driver Manual
Page 14 of 20
6.3.3 Map Descriptor Examples
All three examples below are addressing the same Modbus registers.
// Server Side Map Descriptors where Node Address_Type is ADU
Map_Descriptors
Map_Descriptor_Name , Data_Array_Name , Data_Array_Offset , Function , Node_Name , Data_Type
, Address , Length , Data_Array_Low_Scale , Data_Array_High_Scale , Node_Low_Scale , Node_High_Scale
SMD_AI_01
, DA_AI_01
,0
, Passive , MB_Srv_11 , Input_Register
,1
, 200
,0
, 100
,0
, 10000
SMD_AO_01
, DA_AO_01
,0
, Passive , MB_srv_11 , Holding_Register , 1
, 200
,0
, 100
,0
, 10000
// Server Side Map Descriptors where Node Address_Type is PDU
Map_Descriptors
Map_Descriptor_Name , Data_Array_Name , Data_Array_Offset , Function , Node_Name , Data_Type , Address , Length , Data_Array_Low_Scale , Data_Array_High_Scale , Node_Low_Scale , Node_High_Scale
SMD_AI_02
, DA_AI_02
,0
, Passive , MB_Srv_12 , FC04
,0
, 200
,0
, 100
,0
, 10000
SMD_AO_02
, DA_AO_02
,0
, Passive , MB_srv_12 , FC03
,0
, 200
,0
, 100
,0
, 10000
// For Nodes where Address_Type is Modicon_5digit.
Map_Descriptors
Map_Descriptor_Name , Data_Array_Name , Data_Array_Offset , Function , Node_Name , Address , Length , Data_Array_Low_Scale , Data_Array_High_Scale , Node_Low_Scale , Node_High_Scale
SMD_AI_01
, DA_AI_01
,0
, Passive , MBP_Srv_13 , 30001 , 200
,0
, 100
,0
, 10000
SMD_AO_01
, DA_AO_01
,0
, Passive , MBP_Srv_13 , 40001 , 200
,0
, 100
,0
, 10000
FieldServer Technologies 1991 Tarob Court Milpitas, California 95035 USA Web: www.fieldserver.com
Tel: (408) 262 2299 Fax: (408) 262 2269 Toll Free: (888) 509 1970 email: support@fieldserver.com
FS-8704-03 Modbus TCP Driver Manual
Page 15 of 20
Appendix A. Useful Features
Appendix A.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.
Appendix A.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 will give you a range from 0 to 65535.

Use the scaling function on the FieldServer, which will allow you to set up any range, with 16 bit resolution.
The following example shows how scaling can be achieved on the Server side of the configuration. Note that 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 can be found in the FieldServer Configuration manual.
Example :
Map_Descriptors
Map_Descriptor_Name , Data_Array_Name , Data_Array_Offset , Function , Node_Name , Address , Length , Data_Array_Low_Scale , Data_Array_High_Scale , Node_Low_Scale , Node_High_Scale
SMD_AI1
, DA_AI_01
,0
, Passive , MBP_Srv_11 , 30001 , 200
,0
, 100
,0
, 10000
SMD_AO1
, DA_AO_01
,0
, Passive , MBP_Srv_11 , 40001 , 200
,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.
FieldServer Technologies 1991 Tarob Court Milpitas, California 95035 USA Web: www.fieldserver.com
Tel: (408) 262 2299 Fax: (408) 262 2269 Toll Free: (888) 509 1970 email: support@fieldserver.com
FS-8704-03 Modbus TCP Driver Manual
Appendix A.1.2.
Page 16 of 20
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’ or ‘32Bit_Reg’ etc
Example:
Data_Arrays
Data_Array_Name
DA1
DA2
DA3
DA4
, Data_Format
, Float
, UInt32
, Float
,UInt32
// Client Side Map Descriptors
// For Nodes where Address_Type is PDU
Map_Descriptors
Map_Descriptor_Name , Data_Array_Name
CMD_AO_01
, DA1
CMD_AO_02
, DA2
CMD_AI_01
, DA3
CMD_AI_02
, DA4
, Data_Array_Length
, 20
, 20
,20
,20
, Data_Array_Offset
,0
,0
,0
,0
, Function
, Rdbc
, Rdbc
, Rdbc
, Rdbc
, Node_Name,
, MODBUS DEVICE2
, MODBUS DEVICE2
, MODBUS DEVICE2
, MODBUS DEVICE2
, Data_Type
, Float_Reg
, 32-Bit_Reg
, Input_Float
, Input_Reg_32Bit
, Address
,0
,0
,0
,0
, Length
, 20
, 20
, 20
, 20
Each Map Descriptor will read 20 pairs of registers and store them as 32-bit floating number or 32-bit Integer.
If some how server device send swapped registers (low value register first) then use corresponding _swapped
data_types.
Note: Please note starting addresses per address_type, see section 5.3.2
Appendix A.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 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 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 will respond, but with the last known value of the data. This maintains the
communication link in an active state, but may hide the fact that the Server Node is offline.

Zero_Data - The FieldServer will respond, but with the data values set to zero. If the user normally expects
non-zero values, this option will signal the offline condition without disrupting communications.
FieldServer Technologies 1991 Tarob Court Milpitas, California 95035 USA Web: www.fieldserver.com
Tel: (408) 262 2299 Fax: (408) 262 2269 Toll Free: (888) 509 1970 email: support@fieldserver.com
,Scan_Interval
,1.000s
,1.000s
,1.000s
,1.000s
FS-8704-03 Modbus TCP Driver Manual

Page 17 of 20
FFFF_Data - The FieldServer will respond, but with the data values set to FFFF (hex). If the user normally
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 -

Gateway_Path_Unavailable or Exception_A -

Gateway_Device_Failed or Exception_B -
FieldServer's response will be Exception 4
FieldServer's response will be Exception A
FieldServer's response will be Exception B
Example:
Nodes
Node_Name
DEV11
DEV12
DEV15
DEV16
DEV17
DEV18
,Node_ID
, 11
, 12
, 15
, 16
, 17
, 18
,Protocol
, Modbus/TCP
, Modbus/TCP
, Modbus/TCP
, Modbus/TCP
, Modbus/TCP
, Modbus/TCP
, Node_Offline_Response
, No_Response
, Old_Data
, Zero_Data
, FFFF_Data
, Exception_4.
, Gateway_Path_Unavailable
, Port
,,,,,,-
FieldServer Technologies 1991 Tarob Court Milpitas, California 95035 USA Web: www.fieldserver.com
Tel: (408) 262 2299 Fax: (408) 262 2269 Toll Free: (888) 509 1970 email: support@fieldserver.com
FS-8704-03 Modbus TCP Driver Manual
Page 18 of 20
Appendix B. Troubleshooting
Appendix B.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.
FieldServer Technologies 1991 Tarob Court Milpitas, California 95035 USA Web: www.fieldserver.com
Tel: (408) 262 2299 Fax: (408) 262 2269 Toll Free: (888) 509 1970 email: support@fieldserver.com
FS-8704-03 Modbus TCP Driver Manual
Page 19 of 20
Appendix C. Reference
Appendix C.1. Data Types
If Node parameter Address_Type is set as ADU or PDU, then Data_Type must be specified as follows
Appendix C.1.1.
Address range
1 - 65536
1 – 65536
1 – 65536
1 - 65536
Appendix C.1.2.
Address range
0 - 65535
0 – 65535
0 – 65535
0 – 65535
Appendix C.1.3.
For Address_Type ADU :
Data_Type
Coil
Discrete_Input
Input_Register
Holding_Register
Function Code (Write)
15
n/a.
n/a.
16
Function Code (Read)
1
2
4
3
For Address_Type PDU :
Data_Type
FC01
FC02
FC04
FC03
Function Code (Write)
15
n/a.
n/a.
16
Function Code (Read)
1
2
4
3
For Address_Type Modicon_5digit
When a Modbus address range is specified, a particular Data Type is implied. The defaults are as follows:
Address range
00001 - 09999
10001 - 19999
30001 - 39999
40001 - 49999
Data_Type
Coil
Discrete_Input
Input_Register
Holding_Register
Function Code (Write)
5,15
n/a.
n/a.
6,16
Function Code (Read)
1
2
4
3
Appendix C.2. Read/write Operation
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’
.
FieldServer Technologies 1991 Tarob Court Milpitas, California 95035 USA Web: www.fieldserver.com
Tel: (408) 262 2299 Fax: (408) 262 2269 Toll Free: (888) 509 1970 email: support@fieldserver.com
FS-8704-03 Modbus TCP Driver Manual
Page 20 of 20
Appendix C.3. Driver Error Messages
Message
MB_TCP:#01 FYI. Server
response extra bytes
ignored. Cnt=%d %#x
MB_TCP:#02
FYI.
Master poll extra bytes
ignored. Cnt=%d %#x
MB_TCP:#03 Err. TCP
Frame has multiple
MB_TCP
messages.
Ignored 2nd
Description/Action
This message is printed when the TCP frame contains more bytes than a single
Modbus_TCP message but insufficient extra bytes to form a second complete Modbus
message. There is no explanation for the 'padding' bytes, but since the Driver ignores
the extra bytes and processes the complete message correctly, the message can be
ignored. The driver prints this message once. It is suppressed on subsequent
occurrences.
The driver has detected enough bytes in the TCP frame for two complete Modbus_TCP
messages. The second message is ignored. If this is a problem, re-configure the
remote node so that only one Modbus_TCP message is contained in a single TCP
frame. The driver prints this message once. It is suppressed on subsequent
occurrences
FieldServer Technologies 1991 Tarob Court Milpitas, California 95035 USA Web: www.fieldserver.com
Tel: (408) 262 2299 Fax: (408) 262 2269 Toll Free: (888) 509 1970 email: support@fieldserver.com
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertising