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

NAME

6       modbus_read_input_registers - read many input registers
7

SYNOPSIS

9       int modbus_read_input_registers(modbus_t *ctx, int addr, int nb,
10       uint16_t *dest);
11

DESCRIPTION

13       The modbus_read_input_registers() function shall read the content of
14       the nb input registers to address addr of the remote device. The result
15       of the reading is stored in dest array as word values (16 bits).
16
17       You must take care to allocate enough memory to store the results in
18       dest (at least nb * sizeof(uint16_t)).
19
20       The function uses the Modbus function code 0x04 (read input registers).
21       The holding registers and input registers have different historical
22       meaning, but nowadays it’s more common to use holding registers only.
23

RETURN VALUE

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

ERRORS

29       EMBMDATA
30           Too many bits requested
31

SEE ALSO

33       modbus_read_input_bits(3) modbus_write_register(3)
34       modbus_write_registers(3)
35

AUTHORS

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