Section Four A BASICA/QuickBASIC GPIB-PC Function Calls©National Instruments Corp. 4A-103 GPIB-PC User ManualBASICA Example Program - DeviceBASICA - Using device function calls.100 REM You must merge this code with DECL.BAS.105 REM110 REM Assign a unique identifier to device and120 REM store in variable DVM%.125 REM130 BDNAME$ = "DVM"140 CALL IBFIND (BDNAME$,DVM%)145 REM150 REM Check for error on IBFIND call.155 REM160 IF DVM% < 0 THEN GOTO 2000170 REM180 REM Clear the device.185 REM190 CALL IBCLR (DVM%)195 REM200 REM Check for an error on each GPIB call to210 REM be safe.215 REM220 IF IBSTA% < 0 THEN GOTO 3000230 REM240 REM Write the function, range, and trigger250 REM source instructions to the DVM.255 REM260 WRT$ = "F3R7T3" : CALL IBWRT (DVM%,WRT$)270 IF IBSTA% < 0 THEN GOTO 3000280 REM290 REM Trigger the device.295 REM300 CALL IBTRG (DVM%)310 IF IBSTA% < 0 THEN GOTO 3000320 REM330 REM Wait for the DVM to set RQS or for a340 REM timeout; if the current time limit is too350 REM short, use IBTMO to change it.355 REM360 MASK% = &H4800 : CALL IBWAIT (DVM%,MASK%)370 IF (IBSTA% AND &HC000) <> 0 THEN GOTO 3000380 REM390 REM Since neither a timeout nor an error400 REM occurred, IBWAIT must have returned on410 REM RQS. Next, serial poll the device.