Main Content

Timeout

Specify waiting time to complete read or write operation

Description

You configure Timeout to be the maximum time (in seconds) to wait to complete a read or write operation.

If a timeout occurs, then the read or write operation aborts. Additionally, if a timeout occurs during an asynchronous read or write operation, then

  • An error event is generated.

  • The callback function specified for ErrorFcn is executed.

Note

Timeouts are rounded upwards to full seconds.

Characteristics

Usage

Any instrument object

Read only

Never

Data type

Double

Values

The default value is 10 seconds.

Note that timeouts are rounded upwards to full seconds.

Examples

You can configure the Timeout to be the maximum time in seconds to wait to complete a read or write operation for most interfaces.

For example, create a GPIB object g associated with a National Instruments GPIB controller with board index 0, and an instrument with primary address 1.

g = gpib('ni',0,1);

You might want to configure the timeout value to a half minute to account for slow data transfer.

g.Timeout = 30;

Then when you connect to the instrument and do a data read and write, the timeout value of 30 seconds is used.

See Also

Properties

ErrorFcn