81
6 Useful Functions
81
Useful Functions
Chapter
6
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 will be
rewritten.
The holding register address and data to be changed are specified in the request.
* Be sure to specify the setting code prior to writing setting values for each item.
Example) Changing the
value of compensation (address 40059) to 20 (0x0014).
Note that the relative address is 0x3A when writing in compensation.
The response in the case of being written in normally is the same as request.
* In function code 06, be sure to write in a 16-bit integer data after address 40057. (If the start
address specifies a 32-bit integer data area, an error response will be returned.)
[Request]
Function 1 byte 0x06
Start address 2 bytes 0x0000 to 0xFFFF
Output data 2 bytes
[Response]
Function 1 byte 0x06
Start address 2 bytes 0x0000 to 0xFFFF
Output data 2 bytes
[Error response]
Error code 1 byte 0x86 (Function +0x80)
Exception code 1 byte 01 or 02 or 03
[Request]
Function 06
[Response]
Function 06
Start address (HI) 00 Start address (HI) 00
Start address (LO) 3A Start address (LO) 3A
Compensation (HI) 00 Compensation (HI) 00
Compensation (L
O) 14 Compensation (LO) 14