beautypg.com

National Instruments GPIB-PC User Manual

Page 137

background image

BASICA/QuickBASIC GPIB-PC Function Calls

Section Four A

GPIB-PC User Manual

4A-62

©National Instruments Corp.

QuickBASIC Version 4.0,
replace line 150 with:

150 CALL IBRDIA (TAPE%,RD%(),CNT%)

Board Examples:

1.

Read 56 bytes of data into the integer array

RD%

from a device

at talk address &H4C (ASCII L) and then unaddress it (the
GPIB-PC listen address is &H20 or ASCII space).

100 REM Perform addressing in preparation
110 REM for board read.
120 CMD$ = "? L" ' UNL MLA TAD
130 CALL IBCMD (BRD0%,CMD$)
140 REM Perform board read.
150 CNT% = 56
160 REM

Array

size

is equal

to

CNT%

divided

170 REM by 2.
180 DIM RD% (28)
190 CALL IBRDIA (BRD0%,RD%(0),CNT%)
200 MASK% = &H4100

' TIMO CMPL

210 REM Perform other processing here then
220 REM wait for I/O completion or a
230 REM timeout.
240 CALL IBWAIT (BRD0%,MASK%)
250 REM Check IBSTA% to see how the read
260 REM terminated on: CMPL, END, TIMO, or
270 REM ERR.
280 REM If CMPL or ERR are not set,
290 REM continue processing.
300 IF (IBSTA% AND &H8100) = 0 GOTO 200
310 REM Data is stored in RD$.
320 REM Unaddress the Talker and Listener.
330 CMD$ = "_?"

' UNT UNL

340 CALL IBCMD (BRD0%,CMD$)