21
4 Modbus protocol description
4.6.3 Write one bit
In the write bit function, the data blocks for instruction and response are
identical.
Instruction
Response
Example Writing a bit starting from bit address 0x0340 (this is bit 0 of the word address
0x0034).
For the addresses please refer to Chapter 7.2 Modbus addresses of important
device and process data, Page 47.
Instruction:
Response (as instruction):
Slave
address
Function
0x05
Bit address Bit value
xx00
Checksum
CRC16
1 byte 1 byte 2 byte 2 byte 2 byte
xx = 00 Bit is
set to 0
xx = FF Bit is
set to 1
Slave
address
Function
0x05
Bit address Bit value Checksum
CRC16
1 byte 1 byte 2 byte 2 byte 2 byte
01 05 0340 FF00 8DAA
01 05 0340 FF00 8DAA