modbus_set_byte_timeout.txt 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. modbus_set_byte_timeout(3)
  2. ==========================
  3. NAME
  4. ----
  5. modbus_set_byte_timeout - set timeout between bytes
  6. SYNOPSIS
  7. --------
  8. *void modbus_set_byte_timeout(modbus_t *'ctx', uint32_t 'to_sec', uint32_t 'to_usec');*
  9. DESCRIPTION
  10. -----------
  11. The *modbus_set_byte_timeout()* function shall set the timeout interval between
  12. two consecutive bytes of the same message. The timeout is an upper bound on the
  13. amount of time elapsed before *select()* returns, if the time elapsed is longer
  14. than the defined timeout, an `ETIMEDOUT` error will be raised by the
  15. function waiting for a response.
  16. The value of _to_usec_ argument must be in the range 0 to 999999.
  17. If both _to_sec_ and _to_usec_ are zero, this timeout will not be used at all.
  18. In this case, *modbus_set_response_timeout()* governs the entire handling of the
  19. response, the full confirmation response must be received before expiration of
  20. the response timeout. When a byte timeout is set, the response timeout is only
  21. used to wait for until the first byte of the response.
  22. RETURN VALUE
  23. ------------
  24. The function shall return 0 if successful. Otherwise it shall return -1 and set
  25. errno.
  26. ERRORS
  27. ------
  28. *EINVAL*::
  29. The argument _ctx_ is NULL or _to_usec_ is larger than 1000000.
  30. SEE ALSO
  31. --------
  32. linkmb:modbus_get_byte_timeout[3]
  33. linkmb:modbus_get_response_timeout[3]
  34. linkmb:modbus_set_response_timeout[3]
  35. AUTHORS
  36. -------
  37. The libmodbus documentation was written by Stéphane Raimbault
  38. <stephane.raimbault@gmail.com>