Loading...
Modbus TCP/IP Driver Manual
Page 15 of 23
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 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
, Node_Low_Scale
, Node_High_Scale
, 0
, 0
, 10000
, 0
, 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.
Appendix A.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
Loading...
Terms of Use | Privacy Policy | DMCA Policy
2006-2020 Rsmanuals.com