Modbus Write Multiple Registers (FC16)
Function Code 16
Request
This command is writing the contents of two analog output holding registers # 40002 & 40003 to the slave device with address 17.
11 10 0001 0002 04 000A 0102 C6F0
11: The SlaveID
(11 hex = address 17 )
10: The Function Code 16
(Preset Multiple Registers, 10
hex - 16 )
0001: The Data Address
of the first register.
(
0001 hex = 1 , + 40001
offset = register #40002 )
0002: The number of registers to write
04: The number of data bytes to follow
(2 registers x 2 bytes each = 4 bytes)
000A: The value to write to register 40002
0102: The value to write to register 40003
C6F0: The CRC (cyclic redundancy check)
for error checking.
Response
11 10 0001 0002 1298
11: The SlaveID
(11 hex = address 17 )
10: The Function Code 16
(Preset Multiple Registers, 10
hex - 16 )
0001: The Data Address of the first register.
(# 40002 - 40001 = 1 )
0002: The number of registers written.
1298: The CRC (cyclic redundancy check)
for error checking.