modbus_read_input_registers.txt 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. modbus_read_input_registers(3)
  2. ==============================
  3. NAME
  4. ----
  5. modbus_read_input_registers - read many input registers
  6. SYNOPSIS
  7. --------
  8. *int modbus_read_input_registers(modbus_t *'ctx', int 'addr', int 'nb', uint16_t *'dest');*
  9. DESCRIPTION
  10. -----------
  11. The *modbus_read_input_registers()* function shall read the content of the _nb_
  12. input registers to address _addr_ of the remote device. The result of the
  13. reading is stored in _dest_ array as word values (16 bits).
  14. You must take care to allocate enough memory to store the results in _dest_ (at
  15. least _nb_ * sizeof(uint16_t)).
  16. The function uses the Modbus function code 0x04 (read input registers). The
  17. holding registers and input registers have different historical meaning, but
  18. nowadays it's more common to use holding registers only.
  19. RETURN VALUE
  20. ------------
  21. The function shall return the number of read input registers if
  22. successful. Otherwise it shall return -1 and set errno.
  23. ERRORS
  24. ------
  25. *EMBMDATA*::
  26. Too many bits requested
  27. SEE ALSO
  28. --------
  29. linkmb:modbus_read_input_bits[3]
  30. linkmb:modbus_write_register[3]
  31. linkmb:modbus_write_registers[3]
  32. AUTHORS
  33. -------
  34. The libmodbus documentation was written by Stéphane Raimbault
  35. <stephane.raimbault@gmail.com>