Section Four A
BASICA/QuickBASIC GPIB-PC Function Calls
©National Instruments Corp.
4A-111
GPIB-PC User Manual
QuickBASIC Example Program - Board
QuickBASIC - Using board function calls.
COMMON SHARED IBSTA%, IBERR%, IBCNT%
REM
REM Assign a unique identified to board 0 and
REM store in variable BRD0%.
REM
BDNAME$ = "GPIB0"
CALL IBFIND (BDNAME$,BRD0%)
REM
REM Check for error on IBFIND call.
REM
IF BRD0% < 0 THEN GOSUB FIND-ERROR:
REM
REM Send the Interface Clear (IFC) message to
REM all devices.
REM
CALL IBSIC (BRD0%)
REM
REM Check for an error on each GPIB call
REM to be safe.
REM
IF IBSTA% , 0 THEN GOSUB GPIB-ERROR:
REM
REM Turn on the Remote Enable (REN) signal.
REM
V% = 1 : CALL IBSRE (BRD0%,V%)
IF IBSTA% < 0 THEN GOSUB GPIB-ERROR:
REM
REM Inhibit fron panel control with the
REM Local Lockout (LLO) command, place the
REM DVM in remote by addressing it to listen,
REM send the Device Clear (DCL) message to clear
REM internal device functions, and address the
REM GPIB-PC to talk.
REM
CMD$ = CHR$(&H11)+"#" +CHR$(&H14)+"@"
CALL IBCMD (BRD0%,CMD$)
IF IBSTA% < 0 THEN GOSUB GPIB-ERROR:
REM
REM Write the function, range, and trigger
REM source instructions to the DVM
REM
WRT$ = "F3R7T3" : CALL IBWRT (BRD0%,WRT$)