ser_sr24_set_timeout


int   ser_sr24_set_timeout(
     ser_sr24 handle,   //serial board handle
     unsigned int timeout   //new timeout value to use
     );

Summary

This function sets the timeout value for all functions that may timeout, and that aren't passed an explicit timeout value. This timeout setting simply adjusts how long the API will wait for a response from the serial board before returning a timeout error. The timeout value is specified in milliseconds. If timeout is set to zero, the functions will never time out. When a board is opened, the timeout value defaults to 1000 milliseconds (1 second).

Note: The timeout value is an internal setting of the API, and does not affect the serial I/O board in any way.

Parameters

handle:
    This is the handle to the serial board; it is actually a pointer to the data structure for the board.
timeout:
    This is the timeout value, in milliseconds. If set to 0, the functions will never timeout.

Return Values

Function returns 0 upon success. Possible error codes include:

Visual Basic Notes

The Visual Basic equivalent of this function is the Timeout property. Just set the value of the property to the desired timeout value (in milliseconds). You can retrieve the timeout value by reading the Timeout property.

Example
object.Timeout = 2000   'set the timeout to 2 seconds



Back to Contents Winford Engineering (2000)