modbus_read_input_bits.txt 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. modbus_read_input_bits(3)
  2. =========================
  3. NAME
  4. ----
  5. modbus_read_input_bits - read many input bits
  6. SYNOPSIS
  7. --------
  8. *int modbus_read_input_bits(modbus_t *'ctx', int 'addr', int 'nb', uint8_t *'dest');*
  9. DESCRIPTION
  10. -----------
  11. The *modbus_read_input_bits()* function shall read the content of the _nb_ input
  12. bits to the address _addr_ of the remote device. The result of reading is stored
  13. in _dest_ array as unsigned bytes (8 bits) set to _TRUE_ or _FALSE_.
  14. You must take care to allocate enough memory to store the results in _dest_
  15. (at least _nb_ * sizeof(uint8_t)).
  16. The function uses the Modbus function code 0x02 (read input status).
  17. RETURN VALUE
  18. ------------
  19. The function shall return the number of read input status if
  20. successful. Otherwise it shall return -1 and set errno.
  21. ERRORS
  22. ------
  23. *EMBMDATA*::
  24. Too many discrete inputs requested
  25. SEE ALSO
  26. --------
  27. linkmb:modbus_read_input_registers[3]
  28. AUTHORS
  29. -------
  30. The libmodbus documentation was written by Stéphane Raimbault
  31. <stephane.raimbault@gmail.com>