EasyManua.ls Logo

National Instruments GPIB-PC - Page 184

National Instruments GPIB-PC
262 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Section Four A BASICA/QuickBASIC GPIB-PC Function Calls
©National Instruments Corp. 4A-109 GPIB-PC User Manual
CALL IBRSP (DVM%,SPR%)
IF IBSTA% < 0 THEN GOSUB GPIB-ERROR:
REM
REM Now test the status byte (SPR%).
REM If SPR% is &HC0, the DVM has valid
REM data to send; otherwise, it has a
REM fault condition to report.
REM
IF SPR% <> &HC0 THEN GOSUB DEVICE-ERROR:
REM
REM If the data is valid, read the
REM measurement.
REM
RD$ = SPACE$(16) : CALL IBRD (DVM%,RD$)
IF IBSTA% < 0 THEN GOSUB GPIB-ERROR:
REM
REM To close out a programming sequence,
REM reset the device, and call IBONL
REM to place the device offline.
REM
CALL IBCLR (DVM%)
V% = 0
CALL IBONL (DVM%,V%) : STOP
END
IBFIND-ERROR:
REM A routine at this location would notify
REM you that the IBFIND call failed, and
REM refer you to the handler software
REM configuration procedures.
PRINT "IBFIND ERROR" : STOP
GPIB-ERROR:
REM An error checking routine at this
REM location would, among other things,
REM check IBERR to determine the exact cause of
REM the error condition and then take action
REM appropriate to the application.
REM For errors during data transfers,
REM IBCNT may be examined to determine the actual
REM number of bytes transferred.
PRINT "GPIB ERROR" : STOP

Table of Contents

Related product manuals