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 _modbus_read_input_status()_ function shall return the number of read
  20. input status if 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>