19
4 Modbus protocol description
4.6.1 Read n bit
This function is used to read n bits starting from a specific address.
Data request
Response
Example Reading a bit starting from bit address 0x0340 (this is word address 0x0034).
For the addresses please refer to Chapter 7.2 Modbus addresses of important
device and process data, Page 47.
Data request:
Response:
Slave
address
Function
0x01 or 0x02
Address
first bit
Number
of bits
Checksum
CRC16
1 byte 1 byte 2 byte 2 byte 2 byte
Slave
address
Function
0x01 or 0x02
Number of
byte read
Bit
value(s)
Checksum
CRC16
1 byte 1 byte 1 byte x byte 2 byte
The response always comes in full bytes of 8 bits each.
Non-requested bit values will be complemented with the 0 value.
01 02 0340 0001 B85A
01 02 01 01 6048
Bit value