modbus_object.Timeout Property

Sets or gets the timeout period, in milliseconds, that GPL waits for a response from a MODBUS slave.

modbus_object.Timeout =<timeout>
-or-
...
modbus_object.Timeout

Prerequisites

None

Parameters

None

Remarks

The property allows you to set the timeout period for all Modbus methods that perform I/O with the MODBUS slave.

If this time is exceeded, the method throws an exception. If the timeout period is set to 0, the timeout is disabled and a request may wait indefinitely.

Each modbus_object has an independent timeout value.

Examples

Dim ep As New IPEndPoint("192.168.0.150")
Dim mb As New Modbus(ep)
mb.Timeout = 2000 ' Timeout in 2 seconds

See Also

Modbus Class