Modbus services
Write multiple registers (16)
Function 16 = 16#10, quantity =1
This function code is used to write a block of contiguous registers (1 to approx. 120 registers). Read only parameters can't be written.
Request:
Slave no. | Function | Starting | Quantity of register | Byte count | First register value | ||||
| code | address |
|
|
|
|
|
| |
| 10 |
|
| 00 | 01 | 02 (fixed) |
|
|
|
|
|
| (fixed) | (fixed) |
|
|
| ||
|
|
|
|
|
|
|
| ||
1 byte | 1 byte | 2 bytes | 2 bytes | 1 byte | 2 bytes |
CRC16
2 bytes
Response:
Slave no. | Function code | Starting address | Quantity of register | CRC16 | |||
| 10 |
|
| 00 (fixed) | 01 (fixed) |
|
|
1 byte | 1 byte | 2 bytes | 2 bytes | 2 bytes |
Error response:
Slave no. | Function code | Exception code | CRC16 | |
|
| |||
| 90 |
|
|
|
1 byte | 1 byte | 1 byte | 2 bytes |
Refer to "Error response", page 41.
Example: Write value 60Hz in the parameter [Frequency reference from serial comm.] (FA01) in Altivar 212 slave 1.
Request:
01 | 10 | FA 01 | 00 01 | 02 | 17 70 | F3 9A |
Response:
01 | 10 | FA 01 | 00 01 | 60 D1 |
S1A53844 01/2011 | 37 |