1MODBUS_READ_BITS(3) libmodbus Manual MODBUS_READ_BITS(3)
2
3
4
6 modbus_read_bits - read many bits
7
9 int modbus_read_bits(modbus_t *ctx, int addr, int nb, uint8_t *dest);
10
12 The modbus_read_bits() function shall read the status of the nb bits
13 (coils) to the address addr of the remote device. The result of reading
14 is stored in dest array as unsigned bytes (8 bits) set to TRUE or
15 FALSE.
16
17 You must take care to allocate enough memory to store the results in
18 dest (at least nb * sizeof(uint8_t)).
19
20 The function uses the Modbus function code 0x01 (read coil status).
21
23 The function shall return the number of read bits if successful.
24 Otherwise it shall return -1 and set errno.
25
27 EMBMDATA
28 Too many bits requested
29
31 modbus_write_bit(3) modbus_write_bits(3)
32
34 The libmodbus documentation was written by Stéphane Raimbault
35 <stephane.raimbault@gmail.com>
36
37
38
39libmodbus v3.1.6 02/04/2022 MODBUS_READ_BITS(3)