Loading...
Modbus TCP/IP Driver Manual
Page 17 of 23
Appendix A.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
, Node_Name
, Data_Type
, Address
, Length
, Scan_Interval
CMD_AO_01
, DA1
, 0
, ModbusDevice2
, Reg_Bytes
, 0
, 40
, 1.000s
CMD_AO_02
, DA2
, 0
, ModbusDevice2
, Input_Reg_Bytes
, 0
, 40
, 1.000s
CMD_AI_01
, DA3
, 0
, ModbusDevice2
, Reg_Bytes
, 0
, 320
, 1.000s
CMD_AI_02
, DA4
, 0
, ModbusDevice2
, Input_Reg_Bytes
, 0
, 320
, 1.000s
Each Map Descriptor will read 20 registers and store them as 40 bytes or 320 bits.
Appendix A.4. Reading Data Types
Appendix A.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
Loading...
Terms of Use | Privacy Policy | DMCA Policy
2006-2020 Rsmanuals.com