138
Rockwell Automation Publication 5069-UM003B-EN-P - January 2020
Appendix B
Modbus Command Codes
Preset Single Register (Function Code 06)
Query
This Function Code allows you to modify the contents of a Modbus 4x range in
the slave. This code writes to one register only. Any holding register that exists
within the controller can have its contents changed by this message. However,
because the controller is actively scanning, it can also alter the content of any
holding register at any time. The values are provided in binary up to the
maximum capacity of the controller. Unused high-order bits must be set to zero.
When used with slave address zero (Broadcast mode), all slave controllers load
the specified register with the contents specified.
The following example is a request to write the value ‘3’ to register 40002 in slave
11.
Response
The response to a preset single register request is to retransmit the query message
after the register has been altered.
TIP
• Functions 5, 6, 15, and 16 are the only messages that are recognized as
valid for broadcast.
• This is the structure of the message being sent out to the Modbus
network. The following byte values are in hexadecimal display.
Node Address
Function Code
Data Start Bit High
Data Start Bit Low
Preset Data
Register High
Present Data
Register Low
Error Check Field
(2 bytes)
0B
06
00
01
00
03
CRC
Node Address
Function Code
Data Register High
Data Register Low
Preset Data Register
High
Preset Data Register
Low
Error Check Field
(2 bytes)
0B
06
00
01
00
03
CRC