June 2021
Installation, Operation and Maintenance Manual
MAN712 Rev. 9
Section 8: Modbus RTU Interface
Modbus RTU Interface
74
8.4.3
Function Code 16 (0x10) Write Multiple Registers
This function code is used to write a block of contiguous registers in a slave device.
The ELBS-20 Modbus RTU Interface has implemented 315 Holding Registers.
If quantity of registers is less than 1 or more than 125, Exception code 03 (0x03)
is generated.
Exception Code 03 (0x03) is also generated if byte count field is not twice of the value of
quantity of registers.
If starting address or its combination with quantity of registers is more than 314,
Exception Code 02 (0x02) is generated.
If an error occurs while the slave device is performing the action requested in the query,
Exception Code 04 (0x04) is generated.
Only read register discharges new value without generating Exception Codes.
Broadcast messages are allowed, no response is generated after a broadcast request.
Example of a request to write holding registers with address 0 – 3 to device 2:
Table 16.
Request
Field Name
Value (HEX)
Address
02
Function Code
10
Starting Address Hi
00
Starting Address Lo
00
Quantity of Registers Hi
00
Quantity of Registers Lo
03
Byte Count
06
Register Value Hi (address 0)
00
Register Value Lo (address 0)
04
Register Value Hi (address 1)
01
Register Value Lo (address 1)
F4
Register Value Hi (address 2)
00
Register Value Lo (address 2)
0A
CRC
-
Table 17.
Response
Field Name
Value (HEX)
Address
02
Function Code
10
Starting Address Hi
00
Starting Address Lo
00
Quantity of Registers Hi
00
Quantity of Registers Lo
03
CRC
-