modbus_set_timeout_begin.txt 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. modbus_set_timeout_begin(3)
  2. ===========================
  3. NAME
  4. ----
  5. modbus_set_timeout_begin - set timeout of begin of message
  6. SYNOPSIS
  7. --------
  8. *void modbus_set_timeout_begin(*modbus_t 'ctx', struct timeval *'timeout');*
  9. DESCRIPTION
  10. -----------
  11. The _modbus_set_timeout_begin()_ function shall set the timeout of begin of
  12. message. If the waiting before receiving a message is longer than the given
  13. 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 timeout_begin_old;
  22. struct timeval timeout_begin_new;
  23. /* Save original timeout */
  24. modbus_get_timeout_begin(ctx, &timeout_begin_old);
  25. /* Define a new and too short timeout! */
  26. timeout_begin_new.tv_sec = 0;
  27. timeout_begin_new.tv_usec = 0;
  28. modbus_set_timeout_begin(ctx, &timeout_begin_new);
  29. -------------------
  30. SEE ALSO
  31. --------
  32. linkmb:modbus_get_timeout_begin[3]
  33. linkmb:modbus_get_timeout_end[3]
  34. linkmb:modbus_set_timeout_end[3]
  35. AUTHORS
  36. -------
  37. The libmodbus documentation was written by Stéphane Raimbault
  38. <stephane.raimbault@gmail.com>