Section Four A
BASICA/QuickBASIC GPIB-PC Function Calls
©National Instruments Corp.
4A-113
GPIB-PC User Manual
CMD$ = CHR$(&H19) : CALL IBCMD (BRD0%,CMD$)
IF IBSTA% < 0 THEN GOSUB GPIB-ERROR:
REM
REM Since the DVM and GPIB-PC are
REM still addressed to talk and listen,
REM the measurement can be read as follows.
REM
RD$ = SPACE$(16) : CALL IBRD (BRD0%,RD$)
IF IBSTA% < 0 THEN GOSUB GPIB-ERROR:
REM
REM To close out a programming sequence,
REM send IFC to initialize the bus and
REM call the IBONL function to place the
REM GPIB-PC offline.
REM
CALL IBSIC (BRD0%)
V% = 0 : CALL IBONL (BRD0%,V%) : STOP
END
FIND-ERROR:
REM A routine at this location would
REM notify you that the IBFIND call
REM failed, and refer you to the
REM handler, software configuration
REM 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
REM cause of the error condition and
REM then take action appropriate to
REM the application. For errors during
REM data transfers, IBCNT may be
REM examined to determine the actual
REM number of bytes transferred.
PRINT "GPIB ERROR" : STOP
DEVICE-ERROR:
REM A routine at this location would
REM analyze the fault code returned in
REM the DVM's status byte and take
REM appropriate action.
PRINT "DVM ERROR" : STOP
END