Chapter 5
S Mode Functions — wait
5-54
www.ni.com
Example 1
PRINT #1,"wait \x5000"
'Wait for TIMO or SRQI.
INPUT#1,STATUS%,GPIBERR%,SPERR%,COUNT%
'Get status info.
IF (STATUS% AND &H4000) <> 0 THEN GOTO 1000
'If TIMO bit is set we timed out before
'getting SRQI. Go to an error routine
'at line 1000.
IF(STATUS% AND &H1000) <> 0 THEN GOTO 200
'If SRQI bit set, go to routine to
'conduct a serial poll.
Example 2
PRINT #1,"wait 4"
'Wait indefinitely to become LACS.
INPUT#1,STATUS%,GPIBERR%,SPERR%,COUNT%
'Get status info.
PRINT #1,"rd #10"
'Now that GPIB-232/485CT-A is addressed
'to listen, read 10 bytes from the GPIB.
RESP$=INPUT$(10,#1)
'Input 10 bytes from serial port buffer.
INPUT #1,CNT%
'Input number of valid bytes in CNT$.