2-13
2
620
REM Serial Poll
630
640
PRINT “********** SRQ INTERRUPT OCCURRED! **********”
650
PRINT “Serial Polling now.”
660
Stat=SPOLL(Adr)
670
PRINT “SRQ SPOLL RESULTS: Adr “;Devadr;”Status “;Stat
680
PRINT “*********************************************************”
690
A$=”XXX”
700
ENABLE INTR 7
710
RETURN
720
REM DATA mode
730
PRINT “DATA Address selected!”
740
Adr=701
750
A$=”XXX”
760
RETURN
770
REM CMD Mode
780
PRINT “CMD Address selected!”
785
Adr=700
790
SEND 7;UNL LISTEN Devadr
800
A$=”XXX”
810
RETURN
820
REM GPIB Timeout routine
830
PRINT “GPIB Timeout Occurred!”
840
RETURN
850
END
Figure 2-4 HP BASIC Command Entry/Readout Program
(Cont'd.)
100 REM BASIC GPIB ADDRESS SETTING PROGRAM
110 DIM A$[100], B$[20]
120 CLEAR 7
130 WAIT .1
140 INPUT “Enter Current Device Address (0-30):”, Devadr
150 Adr=700
160 SEND 7;
UN
L LISTEN Devadr
170 WAIT .1
180 A$=”SYST:COM:GPIB:ADDR?”
190 OUTPUT Adr; A$ END
200 ENTER Adr; B$
210 PRINT “ Device address = “;B$
220 INPUT “ Enter new device address (0-30): “,Newadr
230 A$=” SYST:COM:GPIB:ADDR “
240 OUTPUT Adr;A$;Newadr END
250 WAIT .1
260 Adr=700
270 A$=”SYST:COM:GPIB:ADDR?”
280 OUTPUT Adr;A$ END
290 ENTER Adr; B$
300 PRINT “ New Device address = “;B$
310 OUTPUT Adr;”*SAV 0” END
330 END
Figure 2-5 HP BASIC Address Configuration Program