1MODBUS_READ_INPUT_RE(3) Libmodbus Manual MODBUS_READ_INPUT_RE(3)
2
3
4
6 modbus_read_input_registers - read many input registers
7
9 int modbus_read_input_registers(modbus_t *ctx, int addr, int nb,
10 uint16_t *dest);
11
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
25 The modbus_read_input_registers() function shall return the number of
26 read input registers if successful. Otherwise it shall return -1 and
27 set errno.
28
30 EMBMDATA
31 Too many bits requested
32
34 modbus_read_input_bits(3) modbus_write_register(3)
35 modbus_write_registers(3)
36
38 The libmodbus documentation was written by Stéphane Raimbault
39 <stephane.raimbault@gmail.com[1]>
40
42 1. stephane.raimbault@gmail.com
43 mailto:stephane.raimbault@gmail.com
44
45
46
47libmodbus 3.0.8 07/31/2019 MODBUS_READ_INPUT_RE(3)