Quantcast
Viewing all articles
Browse latest Browse all 16

Function 06 Write Single Register

Modbus RTU Function 06 'Preset Single Register'

To write a word (16 bits) to a register you send the following:

Byte 0 Modbus Device Address (1 to 247)
Byte 1 Function Code / Message Type (0x06)
Byte 2 Register Number (high byte)
Byte 3 Register Number (low byte)
Byte 4 Data0
Byte 5 Data1
Byte 6 CRC of bytes 1 to 6 (high byte)
Byte 7 CRC of bytes 1 to 6 (low byte)

The response is a copy of what was sent

Byte 0 Modbus Device Address
Byte 1 Function Code / Message Type (0x06)
Byte 2 Register Number (high byte)
Byte 3 Register Number (low byte)
Byte 4 Data0
Byte 5 Data1
Byte 6 CRC of bytes 1 to 6 (high byte)
Byte 7 CRC of bytes 1 to 6 (low byte)

 

 


Viewing all articles
Browse latest Browse all 16

Trending Articles