
Modbus holding registers
A.2 Modbus function codes
FC410 with Modbus
Operating Instructions, 02/2016, A5E33120874-AC
119
Function code 16 (Write multiple registers)
General exceptions
●
Writing less than 1 or more than 16 registers => Exception 3 (Illegal data value)
●
If ByteCount is not exactly 2 times NoOfRegisters => Exception 3 (Illegal data value)
●
Requesting invalid start address or start address with invalid quantity => Exception 2
(Illegal data address)
Application exceptions:
●
Application errors; min/max limit of parameter exceeded; or parameter write-protected =>
Exception 4 (Slave device error)
●
Application errors include writing to ReadOnly holding registers
Holes/register alignment:
●
If start-address is not the start of a mapped holding register => Exception 2 (Illegal data
address)
●
Writing to holes is allowed (ie ignored - and no exception occurs) - except for the
condition described above
●
If the end address is only part of a mapped holding register item (e.g. one half of a float
value), the action depends on the data type. Writing parts of all data types => Exception 4
(Slave device error)
Function code 16 example
Query
Slave address
1 byte
Function
1 byte
Starting Address Hi
1 byte
Starting Address Lo
1 byte
Quantity of Registers Hi
1 byte
Quantity of Registers Lo
1 byte
Byte Count
1 byte
Registers Value Hi
1 byte
Registers Value Lo
1 byte
:
:
Registers Value Hi
1 byte
Registers Value Lo
1 byte
CRC
2 bytes