National Instruments GPIB-PC User Manual

Page 172

Advertising
background image

Section Four A

BASICA/QuickBASIC GPIB-PC Function Calls

©National Instruments Corp.

4A-97

GPIB-PC User Manual

Board Example:

1.

Write 10 instruction bytes from the integer array

WRT%

to a

device at listen address &H2F (ASCII /) and then unaddress it
(the GPIB-PC talk address is &H40 or ASCII @).

100 REM Perform addressing.
120 CMD$ = "?@/"

' UNL MTA LAD

130 CALL IBCMD (BRD0%,CMD$)
140 REM Perform board write.
150 DIM WRT%(4)
160 WRT%(0) = ASC("F") + ASC("3") * 256
170 WRT%(1) = ASC("R") + ASC("1") * 256
180 WRT%(2) = ASC("X") + ASC("5") * 256
190 WRT%(3) = ASC("P") + ASC("2") * 256
200 WRT%(4) = ASC("G") + ASC("0") * 256
210 CNT% = 10
220 CALL IBWRTI (BRD0%,WRT%(0),CNT%)
230 REM Unaddress all Talkers and
240 REM Listeners.
250 CMD$ = "_?"

' UNT UNL

260 CALL IBCMD (BRD0%,CMD$)

QuickBASIC Version 2.0 and 3.0,
replace line 220 with:

CALL IBWRTI (PTR%,VARPTR(WRT%(0)),CNT%)

QuickBASIC Version 4.0,
replace line 220 with:

CALL IBWRTI (BD%,WRT%(),CNT%)

Advertising