Controller Programs
G-9
IBM PC/XT/AT with National
GPIB PC Interface
Introduction
The following program sends a command message to the
Model 2001 from an IBM PC/XT/AT computer and displays
a response message on the CRT. The computer must be
equipped with the National GPIB PC Interface and the DOS
2.00 (or later revision) operating system. Interface software
must be installed and configured as described in the instruc-
tion manual.
Directions
1. Using the front panel MENU key and the GPIB menu
item, set the primary address of the Model 2001 to 16.
2. With the power off, connect the Model 2001 to the
IEEE-488 interface installed in the IBM computer.
3. Type in BASICA on the computer keyboard to get into
the IBM interpretive BASIC language.
4. Place the interface software disk in the default drive,
type LOAD “DECL”, and press the return key.
5. Add the lines below to lines 1-6 which are now in mem-
ory. Modify the address in lines 1 and 2, as described in
the National instruction manual.
6. Run the program and type in the desired command mes-
sage. For example, to request a reading, type in
:FETCh? and press return. The reading will be displayed
on the CRT.
NATIONAL
10
20
30
40
50
60
70
80
90
100
110
120
130
140
150
160
170
180
190
200
210
220
230
CLS
NA$=”GPIB0”:CALL IBFIND(NA$,BRD0%)
NA$=”DEV1”:CALL IBFIND(NA$,M2001%)
V%=16:CALL IBPAD(M2001%,V%)
V%=&H102:CALL IBPOKE(BRD0%,V%)
V%=1:CALL IBSRE(BRD0%,V%)
INPUT “Enter Program Message “;CMD$
IF CMD$=”EXIT” THEN 210
IF CMD$=”” THEN 70
CALL IBWRT (M2001%,CMD$)
Length = LEN(CMD$)
FOR I = 1 TO Length
Char$ = MID$(CMD$, I, 1)
IF Char$ = “?” THEN GOTO 170
NEXT
GOTO 70
RD$=SPACE$(100)
CALL IBRD(M2001%,RD$)
PRINT RD$
GOTO 70
V%=0:CALL IBONL(M2001%,V%)
CALL IBONL(BRD0%,V%)
END
Clear screen.
Find board descriptor.
Find instrument descriptor.
Set primary address to 16.
Set timeouts.
Set REN true.
Prompt for commands.
See if program is to be halted.
Check for null input.
Send command string.
Determine length of input string.
Identify character in string.
If “?”, then goto 170.
If not a query, goto 70.
Define reading input buffer.
Address 2001 to talk.
Display response message.
Repeat.
Close instrument file.