1MODBUS_SET_RESPONSE_(3) Libmodbus Manual MODBUS_SET_RESPONSE_(3)
2
3
4
6 modbus_set_response_timeout - set timeout for response
7
9 void modbus_set_response_timeout(modbus_t *ctx, struct timeval
10 *timeout);
11
13 The modbus_set_response_timeout() function shall set the timeout
14 interval used to wait for a response. If the waiting before receiving
15 the response is longer than the given timeout, an error will be raised.
16
18 There is no return values.
19
21 struct timeval old_response_timeout;
22 struct timeval response_timeout;
23
24 /* Save original timeout */
25 modbus_get_response_timeout(ctx, &old_response_timeout);
26
27 /* Define a new and too short timeout! */
28 response_timeout.tv_sec = 0;
29 response_timeout.tv_usec = 0;
30 modbus_set_response_timeout(ctx, &response_timeout);
31
33 modbus_get_response_timeout(3) modbus_get_byte_timeout(3)
34 modbus_set_byte_timeout(3)
35
37 The libmodbus documentation was written by Stéphane Raimbault
38 <stephane.raimbault@gmail.com[1]>
39
41 1. stephane.raimbault@gmail.com
42 mailto:stephane.raimbault@gmail.com
43
44
45
46libmodbus 3.0.6 04/02/2014 MODBUS_SET_RESPONSE_(3)