Chapter 5
S Mode Functions — tmo
©
National Instruments Corporation
5-49
tmo
Change or Disable Time Limit
Type
Initialization function
Syntax
tmo [timeio][,timesp]
<CR>
Purpose
You can use
tmo
at the beginning of your program to change the time limits in effect on the
GPIB-232/485CT-A. The time limits prevent the GPIB-232/485CT-A from waiting
indefinitely for critical events to occur.
Remarks
The arguments
timeio
and
timesp
are numeric strings.
timeio
specifies the amount of
time in seconds the GPIB-232/485CT-A waits for an I/O operation (
rd
,
wrt
,
cmd
) or the
wait
function to complete.
timesp
specifies the amount of time in seconds each device is given to
respond to a serial poll. The power-on timeouts are 10 seconds for
timeio
and 0.1 second for
timesp
.
timeio
and
timesp
can be any decimal number between .00001 and 3600, which
corresponds to time limits between 10 microseconds and 1 hour. For example,
10,.1
specifies a time of 10 seconds for I/O operations and 1/10 of a second for serial poll responses.
timeio
and
timesp
can also be 0, which disables either timeout accordingly. Neither
timeio
nor
timesp
can contain commas.
The
timeio
time limit is in effect for the
cmd
,
rd
, and
wrt
functions. If the
GPIB-232/485CT-A cannot complete any of these functions within the period of time set by
timeio
, it aborts the function and records the EABO error. Bytes that were transferred before
the timeout are not affected. The
timeio
time limit is also the maximum amount of time the
wait function waits when you call it with the TIMO bit set in the
wait
mask.
The
timesp
time limit is in effect only for the
rsp
function. If a polled device fails to respond
within the amount of time indicated by
timesp
, the GPIB-232/485CT-A reports an error.
If you want to change only the timeout value for serial polls, a comma must precede the serial
poll timeout value.
If you call
tmo
without an argument, the GPIB-232/485CT-A returns a numeric string
representing the current timeout settings. It records the EARG error if you specify a time
value outside the range of .00001 to 3600 seconds.