91
12 Interface
91
Interface
Chapter
12
05 (0x05) Write Single Coil
The ON or OFF of slave coils is changed.
When broadcast (0) is specified, coils of all slave devices with the same address are rewritten.
The coil address and output value for request are specified.
0xFF and 0x00 are 0x00 at ON, and 0x00 is OFF.
Data other than the above are not modified as improper data.
e.g.) Hold ON (address 00001) is changed to ON.
Note that the relative address is 0x00 when writing in hold ON.
The response of normal write in is the same as request.
* Consider the read/write of coil to be completed by the normal responses.
06 (0x06) Write Single Register
The values of slave holding registers are changed (rewritten).
When broadcast (0) is specified, holding registers of all slave devices with the same address are
rewritten.
The holding register address and the changed data for request are specified.
[Request]
Function 1 byte 0x05
Start address 2 byte 0x0000 to 0xFFFF
Output data 2 byte 0x0000 or 0xFF00
[Response]
Function 1 byte 0x05
Start address 2 byte 0x0000 to 0xFFFF
Output data 2 byte 0x0000 or 0xFF00
[Error response]
Error code 1 byte 0x85 (function +0x80)
Exception code 1 byte 01 or 02 or 03
[Request]
Function 05
[Response]
Function 05
Start address (HI) 00 Start address (HI) 00
Start address (LO) 00 Start address (LO) 00
Hold ON (HI) FF Hold ON (HI) FF
Hold ON (LO) 00 Hold ON (LO) 00
[Request]
Function 1 byte 0x06
Start address 2 byte 0x0000 to 0xFFFF
Output data 2 byte
[Response]
Function 1 byte 0x06
Start address 2 byte 0x0000 to 0xFFFF
Output data 2 byte
[Error response]
Error code 1 byte 0x86 (function +0x80)
Exception code 1 byte 01 or 02 or 03