Basica example program - board – National Instruments GPIB-PC User Manual
Page 180
Section Four A
BASICA/QuickBASIC GPIB-PC Function Calls
©National Instruments Corp.
4A-105
GPIB-PC User Manual
BASICA Example Program - Board
BASICA - Using board function calls
100 REM You must merge this code with DECL.BAS.
105 REM
110 REM Assign a unique identifier to board 0 and
120 REM store in the variable BRD0%.
125 REM
130 BDNAME$ = "GPIB0"
140 CALL IBFIND (BDNAME$,BRD0%)
145 REM
150 REM Check for error on IBFIND call.
153 REM
155 IF BRD0% < 0 THEN GOTO 2000
160 REM
165 REM Send the Interface Clear (IFC) message to
170 REM all devices.
175 REM
180 CALL IBSIC (BRD0%)
190 REM
200 REM Check for an error on each GPIB call.
215 REM
220 IF IBSTA% < 0 THEN GOTO 3000
230 REM
240 REM Turn on the Remote Enable (REN) signal.
245 REM
250 V% = 1 : CALL IBSRE (BRD0%,V%)
260 IF IBSTA% < 0 THEN GOTO 3000
270 REM
280 REM Inhibit front panel control with the
290 REM Local Lockout (LLO) command, place the
300 REM DVM in remote mode by addressing it to
310 REM listen, send the Device Clear (DCL)
320 REM message to clear internal device
330 REM functions, and address the GPIB0 to talk.
345 REM
350 CMD$ = CHR$(&H11)+ "#" +CHR$(&H14)+ "@"
360 CALL IBCMD (BRD0%,CMD$)
370 IF IBSTA% < 0 THEN GOTO 3000
380 REM
390 REM Write the function, range, and trigger
400 REM source instructions to the DVM.
405 REM
410 WRT$ = "F3R7T3" : CALL IBWRT (BRD0%,WRT$)
420 IF IBSTA% < 0 THEN GOTO 3000