1MODBUS_READ_INPUT_BI(3)        libmodbus Manual        MODBUS_READ_INPUT_BI(3)
2
3
4

NAME

6       modbus_read_input_bits - read many input bits
7

SYNOPSIS

9       int modbus_read_input_bits(modbus_t *ctx, int addr, int nb, uint8_t
10       *dest);
11

DESCRIPTION

13       The modbus_read_input_bits() function shall read the content of the nb
14       input bits to the address addr of the remote device. The result of
15       reading is stored in dest array as unsigned bytes (8 bits) set to TRUE
16       or FALSE.
17
18       You must take care to allocate enough memory to store the results in
19       dest (at least nb * sizeof(uint8_t)).
20
21       The function uses the Modbus function code 0x02 (read input status).
22

RETURN VALUE

24       The function shall return the number of read input status if
25       successful. Otherwise it shall return -1 and set errno.
26

ERRORS

28       EMBMDATA
29           Too many discrete inputs requested
30

SEE ALSO

32       modbus_read_input_registers(3)
33

AUTHORS

35       The libmodbus documentation was written by Stéphane Raimbault
36       <stephane.raimbault@gmail.com>
37
38
39
40libmodbus v3.1.6                  07/21/2022           MODBUS_READ_INPUT_BI(3)
Impressum