beautypg.com

National Instruments GPIB-PC User Manual

Page 167

background image

BASICA/QuickBASIC GPIB-PC Function Calls

Section Four A

GPIB-PC User Manual

4A-92

©National Instruments Corp.

Device Example:

1.

Write 10 instruction bytes to the device

DVM%

while performing

other processing.

100 WRT$ = "F3R1X5P2G0"
110 CALL IBWRTA (DVM%,WRT$)
120 MASK% = &H4100

'TIMO CMPL

130 REM Perform other processing here then
140 REM wait for I/O completion or a
150 REM timeout.
160 CALL IBWAIT (DVM%,MASK%)
170 REM Check IBSTA% to see how the write
180 REM terminated on: CMPL, END, TIMO, or
190 REM ERR. If CMPL is not set,
200 REM continue processing.
210 IF (IBSTA% AND &H100) = 0 GOTO 130

Board Example:

1.

Write 10 instruction bytes to a device at listen address &H2F
(ASCII /), while testing for a high priority event to occur, and
then unaddress it (the GPIB-PC talk address is &H40 or ASCII
@).

100 REM Perform addressing in preparation
110 REM for board write.
120 CMD$ = "?@/"

' UNL MTA LAD

130 CALL IBCMD (BRD0%,CMD$)
140 REM Perform board asynchronous write.
150 WRT$ = "F3R1X5P2G0"
160 CALL IBWRTA (BRD0%,WRT$)
170 REM Perform other processing here then
180 REM wait for I/O completion or a
190 REM timeout.
200 MASK% = &H4100

' TIMO CMPL

210 CALL IBWAIT (BRD0%,MASK%)
220 REM Unaddress the Talker and Listener.
230 CMD$ = "_?"

' UNT UNL

240 CALL IBCMD (BRD0%,CMD$)