Loading...
Modbus TCP/IP Driver Manual
Page 20 of 23
//Client Side Map Descriptors
Map_Descriptors
Map_Descriptor_Name
, Data_Array_Name
, Data_Array_Offset
, Function
, Node_Name
, Data_Type
, Length
, Scan_Interval
CMD_AO_01
, DA1
, 0
, RDBC
, ModbusDevice2
, Reg_Bytes
, 40
, 1.000s
CMD_AO_02
, DA2
, 0
, RDBC
, ModbusDevice2
, Input_Reg_Bytes
, 40
, 1.000s
Appendix A.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.
Loading...
Terms of Use | Privacy Policy | DMCA Policy
2006-2020 Rsmanuals.com