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 modbus_read_bits() function shall return the number of read bits if
24 successful. 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[1]>
36
38 1. stephane.raimbault@gmail.com
39 mailto:stephane.raimbault@gmail.com
40
41
42
43libmodbus 3.0.6 04/02/2014 MODBUS_READ_BITS(3)