- 35 -
6.4.2
Function Code 06 (Write Single Holding Register)
Function code 06 (0x06) is used to write one word of data to the specified single register.
Example of request message
The master sends function code = 06 (0x06) to the slave (unit ID = 03). One word (2 bytes) of data
for “Host maintenance mode ON command” will be written to register address 40050 (relative
address = 49 (0x0031)).
Host maintenance mode ON command (with self-resetting) = ON (0x0011)
Message frame
Modbus TCP
Modbus RTU
Remarks
Data item
Data
size
(byte)
No.
Byte
data
Hex
No.
Byte
data
Hex
TRXN ID
Hi
2
(1)
0
0x00
–
–
–
Modbus TCP
only
Lo
(2)
0
0x00
–
–
–
Protocol
ID
Hi
2
(3)
0
0x00
–
–
–
Modbus TCP
only
Fixed at “00”.
Lo
(4)
0
0x00
–
–
–
Quantity
of comm.
data
Hi
2
(5)
6
0x00
–
–
–
Modbus TCP
only
Number of data
which follows
unit ID
Lo
(6)
0x06
–
–
–
Unit ID
1
(7)
3
0x03
(1)
3
0x03
Function code
1
(8)
6
0x06
(2)
6
0x06
Starting
address
Hi
2
(9)
49
0x00
(3)
49
0x00
Write starting
register address
Lo
(10)
0x31
(4)
0x31
Data
Hi
2
(11)
17
0x00
(5)
17
0x00
Write by the
word.
Lo
(12)
0x11
(6)
0x11
Error
check
data
Lo
2
–
–
–
(7)
0x19
Modbus RTU
only
Hi
–
–
–
(8)
0xEB
Common to both Modbus TCP and Modbus RTU.