modbus_set_response_timeout.txt 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. modbus_set_response_timeout(3)
  2. ==============================
  3. NAME
  4. ----
  5. modbus_set_response_timeout - set timeout for response
  6. SYNOPSIS
  7. --------
  8. *void modbus_set_response_timeout(*modbus_t 'ctx', struct timeval *'timeout');*
  9. DESCRIPTION
  10. -----------
  11. The _modbus_set_response_timeout()_ function shall set the timeout interval used
  12. to wait for a response. If the waiting before receiving the response is longer than
  13. the given timeout, an error will be raised.
  14. RETURN VALUE
  15. ------------
  16. There is no return values.
  17. EXAMPLE
  18. -------
  19. [source,c]
  20. -------------------
  21. struct timeval old_response_timeout;
  22. struct timeval response_timeout;
  23. /* Save original timeout */
  24. modbus_get_response_timeout(ctx, &old_response_timeout);
  25. /* Define a new and too short timeout! */
  26. response_timeout.tv_sec = 0;
  27. response_timeout.tv_usec = 0;
  28. modbus_set_response_timeout(ctx, &response_timeout);
  29. -------------------
  30. SEE ALSO
  31. --------
  32. linkmb:modbus_get_response_timeout[3]
  33. linkmb:modbus_get_byte_timeout[3]
  34. linkmb:modbus_set_byte_timeout[3]
  35. AUTHORS
  36. -------
  37. The libmodbus documentation was written by Stéphane Raimbault
  38. <stephane.raimbault@gmail.com>