2-12
2
Figure 2-4 HP BASIC Command Entry/Readout Program
100
REM 4807 COMAND ENTRY / READOUT PROGRAM
110
PRINT “”
120
PRINT “”
130
PRINT “4807 COMAND ENTRY PROGRAM”
140
DIM A$[100]
150
DIM B$[200]
160
Devadr=4
170
Adr=704
180
ON TIMEOUT 7,5 GOTO 820
190
ON INTR 7 GOSUB 620
200
Mask=2
210
ENABLE INTR 7;Mask
220
GOSUB 470
230
CLEAR Adr
240
WAIT .1
250
GOSUB 770
260
WAIT .1
270
CLEAR Adr
280
GOSUB 520
290
PRINT “Device address = “;Devadr,
300
LINPUT “ENTER COMAND STRING, or HELP for Directions”,A$
310
IF
A$=”HELP” THEN GOSUB 520
320
IF
A$=”SPOL!” THEN GOSUB 650
330
IF
A$=”DATA!” THEN GOSUB 720
340
IF
A$=”CMD!” THEN GOSUB 770
350
IF
(A$<>”ENTER” AND A$<>”XXX”) THEN
360
PRINT “OUTPUTTING->”,A$
370
OUTPUT Adr;A$ END
380
END IF
390
IF POS(A$,”ENTER”)>0 THEN GOSUB 420
400
IF POS(A$,”?”)>0 THEN GOSUB 420
410
GOTO 290
420
REM GET ENTER DATA
430
PRINT “
WAITING FOR DATA.”
440
ENTER Adr;B$
450
PRINT “
DATA STRING ->”,B$
460
RETURN
470
REM Change address
480
INPUT “Enter Device Address (0-30) : “,Devadr
490
Adr=700
500
A$=”XXX”
510
RETURN
520
REM Help Menu
530
540
PRINT “HELP
for this menu”
550
PRINT “SPOL!
to Serial Poll Device address”
560
PRINT “DATA!
select DATA address”
570
PRINT “CMD!
select CMD address”
580
PRINT “ENTER
to read data from Device address”
590
600
A$=”XXX”
610
RETURN