Listing - HP 7470A Interfacing And Programming Manual

Graphic plotter
Hide thumbs Also See for HP 7470A:
Table of Contents

Advertisement

)
.')
The program lines to change pens and line type, and the subroutine
itself are listed here, followed by a reduced version of the completed
plot.
3 8 0
3 9 0
1000
1010
1020
1 0 3 0
1040
1 0 5 0
1060
1 0 7 0
1 0 8 0
1 0 9 0
1 1 0 0
P R I N T
GOSUB
" S P 1 ; L T 4 , 6 "
1 0 0 0
!
P L O T T I N G
SUBROUTINE
RERD
X , Y , P
I F
P - 1
THEN
P R I N T
I F
P - 0
THEN
P R I N T
I F
P - 3
THEN
1 0 9 0
DRTH
1 , 9 8 , 0 , 2 , 1 0 0 ,
PD"
PU"
1
102,1,4,105, 1 ,5, 107, 1 ,6,110,1
DRTfl 7,125,1,8,112,1,9,115,1,10,125,1,11,130,1
DRTR 12,122,1,0,0,3
GOTO 1010
PRINT "LT4,G PU3.2,1G5 PD4.7,165SP0;"
RETURN
1981 SALES BY REGION
SALES *
(THOUSANDS)
150
125
UNITED STATES
EUROPE
SOUTH AMERICA
100
J
J
CALENDAR MONTH
i PUTTING THE COMMANDS TO WORK
Listing
A complete listing of the program follows. This listing contains all the
BASIC statements necessary to have this program run on an HP-85
computer with an HP-IB interface and the plotter set to address 5.
When the plotter is used with an RS-232-C interface, line 10 should be
replaced by other lines which send the escape code sequences necessary
to turn on the plotter and establish handshaking. In some PRINT state­
ments, semicolons or commas are used to ensure that HP-GL com­
mands will have the necessary separators or no extra spaces. You may
need to make changes for your computer's BASIC, or you can use some
other programming language and send the strings of HP-GL com­
mands using your language's output statements and looping techniques.
NOTE: The end-of-text character * ■ is equivalent to N on the HP-85's
display and internal printer. (N is obtained on the HP-85 by pressing
CTRL and c simultaneously. On many computers, you can also use the
CHR$(3) function to generate the end-of-text character.) This program
listing was produced on an HP 7310 printer. ■
1 0 P R I N T E R
I S
7 0 5 , 8 0
2 0 P R I N T
" I N ; S P 1 ; I P 1 2 5 0 , 7 5 0 , 9 2 5 0 , 8 2 5 0 ; "
3 0 P R I N T
" S C 1 , 1 2 , 0 , 1 5 0 ; "
4 0 P R I N T
" P U 1 , 0
PD 1 2 , 0 , 1 2 , 1 5 0 , 1 , 1 5 0 , 1 , 0
P U "
5 0 P R I N T
" S I . 2 , . 3 ; T L 1 . 5 , 0 "
6 0 FOR X - 1
TO
12
7 0 P R I N T
" P R " ; X , " , 0 ;
X T ; "
8 0 RERD R$
9 0 P R I N T
" C P - . 3 3 , - 1 ; L B " ; R t ; " V
1 0 0 NEXT X
1 1 0 P R I N T
" P R 6 . 5 , 0 ; C P - 7 , - 2 . 5 ;
LBCRLENDRR
M O N T H V
1 2 0 FOR Y - 0
TO 1 5 0 S T E P
2 5
1 3 0
P R I N T
" P R
1 , " , Y , " Y T ; "
140 IF Y<100 THEN PRINT "CP-3,-.25;LB";Y;"<v"
150 IF Y>99 THEN PRINT "CP-4,-.25; LB";Y;"V
160 NEXT Y
170 PRINT "PR1,150 CP-3.5,2 LBSRLES *«i,CP-9, -1 "
180 PRINT "LB(THOUSRNDS)
UNITED STATES
V
190 PRINT "LBEUROPE
JfiPflN
SOUTH RMERICRV
200 PRINT "SPO;"
2 1 0
D I S P
"CHRNGE
TO WIDE
P E N S "
220 PRUSE
230 DISP " "
2 4 0
P R I N T
" S P 1
P R 6 , 1 5 0
S I . 4 , . 6
C P - 9 . 5 , 2 . 0 "
2 5 0
P R I N T
" L B 1 9 8 1
SRLES BY
REGION'S,"
2 6 0
P R I N T
" S P 1 ; L T 3 , 6 ; P R 1
2 3 P D 2
2 5
3
18
4 2 2
5
2 3 "
2 7 0
P R I N T
" P D 6
2 7
7 2 7
8 2 5
9 2 4
1 0 2 8
11 2 7
12
2 7 P U "
2 8 0
P R I N T
" P R 7 . 8 , 1 6 5
P D 9 . 3 , 1 6 5
P U "
2 9 0
P R I N T
" S P 2 ; L T 6 , 8 ; P f l 1 , 4 5 ; P D ; P R 2 , 5 0 , 3 , 5 2 , 4 , 5 3 , 5 , 5 2 "
3 0 0
P R I N T
" P D G , 5 1 , 7 , 5 5 , 8 , 5 6 , 9 , 5 6 , 1 0 , 5 8 , 1 1 , 5 8 , 1 2 , 6 0 P U "
3 1 0
P R I N T
" P R 1 0 . 1 , 1 8 5
P D 1 1 . 6 , 1 6 5
P U "
(Program listing continued)
PUTTING THE COMMANDS TO WORK 8-9

Advertisement

Table of Contents
loading

Table of Contents