6.5 Write multiple registers
Command messages
The multiple register write functions (10hex) allows the master to write data to the slaves
registers. The command message of a multiple register write is structured as shown below.
The initial slave address is 1. Address 0 (broadcast) and other values between 1 and 255 can be
used.
The function code of this message is 10hex (write multiple registers).
The starting register is the rst register to be written to.
The quantity indicates how many consecutive 16-bit registers are to be written to. The quantity
may range from 1 to 25 registers. If the quantity is greater than 25 an error code of 03 hex is
returned in the exception response message.
The Byte count is the number of bytes of data to be written to the device. The number of bytes
is actually the quantity times 2, since there are two bytes of data in each register.
The data section of the command message contains 8 upper and 8 lower bits of data for each
register that is being written to.
CRC check and exception handling is performed as described for command ‘Read multiple
registers’.
Table 6-11 Write multiple coil command messages
Message byte Example
Slave address xxhex
Function code 10hex
Starting register Upper 00hex
Lower 20hex
Quantity Upper 00hex
Lower 04hex
Byte count xxhex
Starting register value Upper xxhex
Lower xxhex
Next register value Upper xxhex
Lower xxhex
Last register value Upper xxhex
Lower xxhex
CRC-16 Lower xxhex
Upper xxhex
Normal response
The normal response message contains the same slave address and function code as the
command message.
The starting register is the rst register that was written to.
Functions codes
6.5 Write multiple registers
Modbus RTU RS 485
30 Operating Instructions, 03/2021, A5E00753974-AB