Hi to everyone,
I’m trying to read some modbus registers from a board and the communication
works well . My problem is that I need to read a single bit of a register .
For example I need to read only the bit 9 of the 16 bit register 11160.
Unfortunately, it won’t be possible to directly query a single bit within a 16-bit Modbus register. The Modbus protocol itself doesn’t support addressing individual bits inside a holding register or input register; it only allows reading the entire 16-bit value.
If your device supports it, individual bits can be addressed via coils or discrete Inputs, but not within a register.
A common approach is to read the full register value and then use bitwise operations on the received data to check the specific bit you need on the client side.