HP 7470 schematic

)
)
ffl Getting Started
( |Q HP-IB Interfacing
L33 Establishing Boundaries and Units
) HH RS-232-C/CCITT V.24 Interfacing
^43 Controlling the Pen and Plotting
■II HP-IL Interfacing
J[l Enhancing the Plot
•^3 Labeling
J
BO Instruction Syntax
INTERFACING
AND
PROGRAMMING
MANUAL
HP 7470A
Graphics Plotter
RS-232-C/CCITT V.24
..DESIGNED FOB..
'SYSTEMS'
P
Jtl Digitizing
Reference Material
Obtaining Information from the Plotter
^ Putting the Commands to Work
ID
) PART
\ MICROFICHE NO. 07470-90051 LfiM PACKARD PRINTED IN U.S.A.
NO.
07470-90001 WAo% HEWLETT OCTOBER 1984
)
)
)
) ) )
J
"\
)
)
3
3
1
/
)
tbutiitmt.
)
J
')
)
')
)
•"
')
■)
-s
INTERFACING
AND
HP 7470A
Graphics Plotter
PROGRAMMING
MANUAL
s
^
RS-232-C/CCITT V.24
p
S
NO POSTAGE
NECESSARY
IF MAILED
IN
THE
UNITED STATES
BUSINESS REPLY MAIL
FIRST CLASS PERMIT
NO.
5963 SAN DIEGO. CA
U.S.A.
POSTAGE WILL BE PAID BY ADDRESSEE
HEWLETT
E£l
San Diego Division Attn: Marketing Communications
16399 West Bernardo Drive
San Diego, CA U.S
PACKARD
A.
92127-9989
©1982,
16399 W. Bernardo Drive. San Diego, CA 921271899
1984, by Hewlett-Packard Company
-rti^sto*
''-Seim— . *- '***!&
&
■.
Sd
,1
»j
i
Vfl
'>*S.
)
Manual Summary
Chapter 1: Getting Started
Contains information concerning manual usage, a description of the plotter, its interfaces, the HP-GL language, and three instructions.
Chapter 2: Establishing Boundaries and Units
Explains the concept of plotting area, plotter and user units, scaling, and the instructions used to set and output the scaling points and window, and to scale the plotting area.
Chapter 3: Controlling the Pen and Plotting
Describes the instructions for pen control and vector plotting.
Chapter 4: Enhancing the Plot
Describes instructions for drawing tick marks and differentiating traces.
Chapter 5: Labeling
Describes the instructions used in labeling to set direction, size, and slant of characters, as well as instructions for character set and label terminator selection and for designing your own characters.
Chapter 6: Digitizing
Describes the instructions used to digitize with the plotter and demon­strates how to check for the presence of a digitized point.
Chapter 7: Obtaining Information from the Plotter
Describes the instructions used to obtain information about pen posi­tion, errors, and capabilities of the plotter.
Chapter 8: Putting the Commands to Work
A step-by-step example illustrating the procedures to be followed to draw labels and plot data using HP-GL instructions.
Chapter 9: HP-IB Interfacing
Summarizes operation of the plotter with the Hewlett-Packard Interface Bus (HP-IB) and explains the methods for addressing and sending and receiving data over the interface bus.
Manual Summary (Continued)
Appendix B: Instruction Syntax
Provides a summary of both HP-GL and device control instructions.
Appendix C: Reference Material
Includes a summary of default conditions, error messages, scaling equations, NOP instructions, ASCII codes, and character sets.
Chapter 10: RS-232-C/CCITT V.24 Interfacing
Describes how to connect the plotter with a terminal and/or computer, summarizes the methods for establishing a handshake protocol be-
tween the plotter and computer, and explains the device control instruc-
tions that are used to set up and control the handshake protocol.
Chapter 11: HP-IL Interfacing
Describes the Hewlett-Packard Interface Loop (HP-IL) and explains the methods for sending and receiving data over the interface loop.
Appendix A: An HP-IB Overview
Provides an overview of the Hewlett-Packard Interface Bus (HP-IB).
ii MANUAL SUMMARY
MANUAL SUMMARY iii
) ) )
)
)
)
)
)
) ) )
)
3
) )
mm
)
) ) ) )
)
)
)
)
)
) ) )
)
)
Table of Contents
Chapter 1: Getting Started
What You'll Learn in This Chapter
HP-GL Instructions Covered
Terms You Should Understand
How to Use HP 7470 Documentation
For First Encounters with the 7470 For First Encounters with HP-GL For Experienced HP-GL Programmers
Understanding Manual Conventions and Syntax A Brief Look at the 7470 Plotter The 7470 Plotter's Instruction Set HP-GL Syntax How to Use the Examples in This Manual 1 The Default Instruction, DF 1 The Initialize Instruction, IN 1 The Input Mask Instruction, IM 1 Looking Ahead 1
Chapter 2: Establishing Boundaries and Units 2-1
What You'll Learn in This Chapter 2-1
HP-GL Instructions Covered 2-1
Terms You Should Understand 2-1 The Plotting Area 2-2 Unit Systems 2-3
The Plotter Unit 2-3
User Units 2-3 Setting the Scaling Points 2-3
Setting PI and P2 Manually 2-4 The Input PI and P2 Instruction, IP 2-4 The Output PI and P2 Instruction, OP 2-5 The Scale Instruction, SC 2-6 The Input Window Instruction, IW 2-9 The Output Window Instruction, OW 2-10 Advanced Programming Tips 2-11
Chapter 3: Controlling the Pen and Plotting 3-1
What You'll Learn in This Chapter 3-1
HP-GL Instructions Covered 3-1
Terms You Should Understand 3-1
; iv TABLE OF CONTENTS
P ::"! Table of Contents (Continued)
Chapter 3: Controlling the Pen and Plotting (Continued)
rrm
fgr 3^
C 3
iR.
^0~ MM Plotting with Variables 3-11
The Pen
The Select Pen Instruction, SP 3-2
The Velocity Select
-™ The Plot Absolute Instruction, PA 3-4 The Plot Relative Instruction, PR 3-8
~~ The Circle Instruction, CI 3-12
am The Arc Absolute Instruction, AA 3-17
Instructions, PU and PD 3-2
Instruction, VS 3-3
5
~U3 The Arc Relative Instruction, AR 3-19
^T 3 Chapter 4: Enhancing the Plot 4-1
" What You'll Learn in This Chapter 4-1 _ n HP-GL Instructions Covered 4-1 !■'
IB The Tick Instructions, XT and YT 4-2
The Tick Length Instruction, TL 4-2 P: 3 The Symbol Mode Instruction, SM 4-4 ~ - J The Line Type Instruction, LT 4-6
jm:
:a^ Chapter 5: Labeling 5-1
What You'll Learn in This Chapter 5-1
; "J HP-GL Instructions Covered 5-1
E
:
™ Terms You Should Understand 5-1
Plotter Character Sets 5-2
E; ill The Designate Standard Character Set Instruction, CS 5-3
The Designate Alternate Character Set Instruction, CA 5-4
f *m The Select Standard Set Instruction, SS 5-4 C': ifl The Select Alternate Set Instruction, SA 5-5
i The Define Terminator Instruction, DT 5-6
C i ^3 The Label Instruction, LB 5-7
Labeling with Variables 5-9
,. The Absolute Direction Instruction, DI 5-10
E
1
i3 The Relative Direction Instruction, DR 5-11
Spacing Between Characters 5-12
C; fj The Character Plot Instruction, CP 5-13
' The Absolute Character Size Instruction, SI 5-15
_j^
The Relative Character Size Instruction, SR 5-16
Rll3 The Character Slant Instruction, SL 5-18
x
»fc^
--"3 TABLE OF CONTENTS V
) ) )
)
)
)
) )
)
3
)
3
)
)
3 3 3
'iff-iftti!iiTiffiriiiiiii»iiiiiiMiii
3
)
)
) ) )
3
)
)
)
3
)
)
3
3
m
>
Table of Contents (Continued)
) Chapter 5: Labeling (Continued)
)
) Advanced Programming Tips 5-27
) What You'll Learn in This Chapter 6-1 \ HP-GL Instructions Covered 6-1
) The Digitize Point Instruction, DP 6-2
)
) Digitizing with the 7470 6-4
) Manual Method 6-4
) HP-GL Instructions Covered 7-1
x Terms You Should Understand 7-1
) Notes for an HP-IB User 7-2
) The Output Status Instruction, OS 7-8
\ Summary of Output Response Types 7-9
( )
The User Defined Character Instruction, UC 5-19 Parameter Interaction in Labeling Commands 5-21
Chapter 6: Digitizing 6-1
Terms You Should Understand 6-1
Preparing Your Plotter for Use as a Digitizer 6-2
The Digitize Clear Instruction, DC 6-3 The Output Digitized Point and Pen Status Instruction, OD 6-3
Monitoring the Status Byte 6-5
HP-IB Interrupts and Polling 6-7
Chapter
7:
Obtaining Information From the Plotter 7-1
What You'll Learn in This Chapter 7-1
A Brief Word about Plotter Output 7-2
Notes for an RS-232-C User 7-2 Notes for an HP-IL User 7-2
The Output Actual Position and Pen Status
Instruction, OA 7-3
The Output Commanded Position and Pen Status
Instruction, OC 7-4
The Output Error Instruction, OE 7-5
The Output Factors Instruction, OF 7-6
The Output Identification Instruction, 01 7-7 The Output Options Instruction, 00 7-7
Table of Contents (Continued)
Chapter 8: Putting the Commands to Work 8-1
What You'll Learn in This Chapter 8-1 Problem 8-2 Solution 8-2
Setup and Scaling 8-2 The Axes and Their Labels 8-3 Adding Color and Emphasis 8-5
Plotting Your Data 8-6 Listing 8-9 Advanced Programming Tips 8-10
Filling and Hatching 8-10 Filling a Bar 8-10 Hatching a Bar 8-12 Filling Segments of Pie Charts 8-13
Chapter 9: HP-IB Interfacing 9-1
What You'll Learn in This Chapter 9-1 HP-IB Implementation on the 7470 9-2 Interface Switches and Controls 9-2
Addressing the Plotter 9-2
Bus Commands ■ 9-4
Reaction to Bus Commands DCL, SDC, and IFC 9-4 Serial and Parallel Polling 9-4
Addressing the 7470 as a Talker or Listener 9-6
Computers with No High Level I/O Statements 9-6
Computer with High Level I/O Statements 9-6
Sending and Receiving Data 9-7
Computer-to-Plotter 9-7 Plotter-to-Computer 910
Chapter 10: RS-232-C/CCITT V.24 Interfacing 10-1
What You'll Learn in This Chapter 10-1 Setting Up Your RS-232-C Plotter: a Checklist 10-2 Plotter Environments 10-2
Using a Plotter Directly Connected to a
Computer Mainframe or Personal Computer 10-2
Using a Plotter in an Environment with a Terminal 10-4
Using the Plotter in a Terminal-only Environment 10-9
Connecting the RS-232-C Interface 10-10
VI TABLE OF CONTENTS
J
TABLE OF CONTENTS Vll
)
)
) ) ) )
3 3
)
3 3
) ) )
)
3 3
MiiiniUiwWiiiiiiii iiiiniiir'fii -iniraBiTu utiiirwi-Tn--i-nr r r .r-.inrn iMfin.1 - .ir-.ii^.,.■ i«->i ^-n-mi.,.,!,,.
^,
MiM^m^m^MmMmWaKK^^a--^-.
3
3
)
3
)
)
)
3
) ) )
) )
)
3
)
ammiMmimmmm
Table of Contents (Continued)
) Chapter 10: RS-232-C/CCITT V.24 Interfacing (Continued) \ Output Baud Rate 10-12
Stop Bits 10-13
-' Transmission Errors 10-13
) Handshaking 10-14
N
Software Checking
) ) )
)
) )
)
3
')
)
)
)
)
)
) )
)
mm
)
)
)
:>
)
)
)
)
)
)
) )
)
)
)
HP-IL — Hewlett-Packard Interface Loop — an interface used on some Hewlett-Packard personal computing products to communicate with peripheral devices such as the 7470 plotter. The HP-IL interface is standard on the Option 003 plotter.
)
B
)
How to Use HP 7470 Documentation
) This manual contains interfacing and programming information for
the HP 7470 Plotter and all its interfacing options. The Option 001 plotter is equipped with the RS-232-C/CCITT V.24 Interface. The Option 002 plotter is interfaced through the Hewlett-Packard Interface Bus (HP-IB) which conforms to ANSI/IEEE 488-1978 specifications. The Option 003 plotter is equipped with the Hewlett-Packard Interface Loop for personal computing devices. All interfaces use the Hewlett-Packard Graphics Language (HP-GL) for control of plotter graphics capabilities. Unless specifically noted, all information in this manual pertains to all configurations.
NOTE: All information in this manual for Option 001 plotters applies equally to RS-232-C and CCITT V.24 interfaces. For purposes of sim­plicity, both are referred to as RS-232-C. ■
Documentation for this plotter is designed to enable you to use the plotter easily without reading unnecessary manuals. All plotters are shipped with this manual, an Operator's Manual (Part No. 07470-
90002), an Interconnection Guide (07470-90003), and a Reference Card (07470-90004). The Operator's Manual contains all information you will need to operate, but not program, the plotter. The Interconnect Guide explains how to physically connect your plotter to certain computers or calculators, and contains instructions for verifying that the connection has been made. The Reference Card contains a list of the plotter's HP-
GL instructions with their parameters, its device control instructions
for the RS-232-C version, and a list of error numbers and their meanings.
For First Encounters with the 7470
If you have just received your HP 7470, read the Operator's Manual and the Interconnection Guide before attempting to operate the plotter. After inspecting your plotter, its power cord, and accessories as described in the Operator's Manual, refer to the appropriate chapter of this manual for initial setup and addressing or handshaking protocol for your configuration. RS-232-C users should read Chapter 10, HP-IB users should read Chapter 9, and HP-IL users should read Chapter 11.
For First Encounters with HP-GL
If you have never programmed in HP-GL, after reading the interfacing chapter, read Chapters 1 through 5 in order. These chapters describe the instructions you will use in almost every application. Running the examples given with the instructions will help you learn. Next, read
Chapter 8 to see how all the instructions work together in a program. When you have an application requiring digitizing or plotter output, read Chapters 6 and 7.
For Experienced HP-GL Programmers
If you are an experienced HP-GL programmer, you may find Appendix B of this manual or the Reference Card most helpful. Since there are
differences in syntax between this and other plotters, you should read
Chapter 1 of this manual before programming. The 7470 has added
capabilities not found in earlier plotters. Among these are the ability to
plot to non-integer user-unit values, to mirror labels using negative size and direction parameters, and to output the current window values. To understand these differences, you need to read the sections on scaling (SC,
Chapter
and direction in Chapter 5. In the instruction set summary in Appendix
B,
page numbers for the complete description are listed with each
instruction.
2),-
plotting (PA and PR, Chapter 3), and setting label size
Understanding Manual Conventions and Syntax
Before reading any part of this manual, you should understand the meaning of type styles, symbols, and number representation used in text. A detailed explanation of syntax symbols is given in the section entitled HP-GL Syntax in this chapter and Command Syntax for Device Control Instructions in Chapter 10. The following conventions also apply. Words typed in small boldface type are either buttons, switches, or words actually found on the plotter or computer. Headings in liWHiMJI type are used to help locate specific parts of the writeup of an instruction. i:i*'ia:M^ type in a smaller size is used to denote a single ASCII character which should be sent to the plotter. Numbers are typed using SI (International System of Units) standards; numbers with more than four digits are placed in groups of three, separated by a
1-2 GETTING STARTED
GETTING STARTED 1-3
)
)
.)
)
)
) ) )
) ) )
)
) ) )
)
)
MMMU
) )
) ;
)
) )
)
)
) )
)
; )
)
J
tf
)
'
)
V
)
) )
■■
.)
)
<:
)
;
)
'
)
<■
)
(
)
space instead of commas, counting both to the left and right of the decimal point (54 321.123 45).
Follow the documentation road map below:
ALL USERS
OPERATOR'S
MANUAL
07470-90002
INTERCONNECTION
GUIDE
07470-90003
RS-232-C USER
INTERFACING AND
PROGRAMMING
MANUAL,
CHAPTER 10
07470-90001
HP-IB,
USERS
HP-IL
^
t
»
—4
USER OF SOFTWARE
PACKAGE
YOUR
SOFTWARE MANUAL
GRAPHICS ROM USER
GRAPHICS ROM
MANUAL
HP-GL PROGRAMMER
INTERFACING AND
PROGRAMMING
MANUAL
07470-90001
CHAPTERS 1-8, AND
CHAPTER 9, 10, OR 11
A Brief Look at the 7470 Plotter
The HP 7470 Graphics Plotter is a vector plotter which produces high
quality, multicolor graphics plots on two sizes of drawing media: English ANSI A programmable pen velocity and a choice of standard fiber tip or trans­parency pens, the 7470 can produce distinctive graphics not only on standard paper, but also on other media such as transparency film.
The plotter offers both fast plotting speed and high line quality,
achieved using Hewlett-Packard's micro-grip drive technology. This technology provides low-inertia grit-covered wheels to move the paper in one axis while the pen moves along the other axis. Plotting occurs with approximately 2 g acceleration and a maximum velocity of 38.1 cm/s (15 in./s). The result is exceptional line and character quality and high throughput. The 7470 has addressable resolution of 0.025 mm (0.001 in.) and repeatability of 0.10 mm (0.004 in.) for any given pen.
The multicolor graphics capability is provided by programmed or front­panel selection of two pens. If additional colors are desired, the pro­gram can be paused to allow manual installation of additional pens. Seven different dashed-line fonts and symbol mode plotting provide
additional trace identification capabilities.
Character plotting speed of up to six characters per second enables you to produce fully-lettered graphs quickly. Annotation can be easily done
using any of five character sets, including three European sets. Text can be written in any direction, with or without character slant, and in varying sizes.
The 7470 is engineered to be especially useful in the areas of business
graphics, statistics, medicine, numerical control, surveying, and engi­neering design. An optional overhead transparency kit enables you to produce high quality graphic transparencies from your plotting pro-
grams. For faster comprehension, you can present economic trends, engineering or scientific data, marketing plans, profit data, or sales forecasts pictorially. And with a choice of media, you can create paper hardcopy for an individual's attention or transparencies for group
presentations.
Whether data are tabulated, measured, or computed, depend on the reliable 7470 to prepare multicolored plots of excellent line quality and
high resolution.
(8V2 X
11 in.) or metric ISO A4 (210 X 297 mm). With
{
)
1-4 GETTING STARTED
MIMH
tJUmitmi/aH
■^^^^—
■J-^**—^-**;*
GETTING STARTED
-^.--
1-5
•,Q...i^^.
■■•
)
) )
0
)
)
) )
) )
) ) )
)
)
)
)
m*
MMMMH
)
i
)
)
; )
)
■'
-
)
)
;■ )
' ) \ )
)
)
.
)
)
«*_J
)
The 7470 Plotter's Instruction Set
All three interface configurations for the HP 7470 Plotter use the same Hewlett-Packard Graphics Language (HP-GL) instruction set, with
i
minor exceptions.* HP-GL consists of two-letter mnemonic instructions which activate the plotter. A table listing the instructions alphabetically is located at the end of the next section. Syntax descriptions and explanations of these instructions are contained in Chapters 1 through
8. Six additional HP-GL instructions cause no operation but are in­cluded for compatibility with other HP plotters. These instructions are listed in Appendix C.
Fourteen additional instructions, called device control instructions, are required by the RS-232-C configuration. These instructions are used to establish plotter output and handshake protocol, and to control condi­tions which are pertinent only to the RS-232-C environment. In an RS-232-C plotter, all HP-GL instructions enter the plotter's internal buffer and are executed in a first-in, first-out sequence. Device control instructions do not enter the buffer, but instead are executed imme­diately upon receipt. Refer to Chapter 10 for the syntax description and an explanation of the device control instructions.
HP-GL Syntax
An HP-GL instruction is a two-letter mnemonic, which may be upper­or lowercase. A command is defined as an instruction followed by its parameter field, if any, and a terminator. If parameters follow the mnemonic, they must be separated from each other by at least one comma or space, or by a + or — sign which may be preceded by commas or spaces. Optional commas and/or spaces may be used as separators before, after, and between the mnemonic and before the terminator. An instruction is terminated by a semicolon, nonalphabetic and nonnu­meric characters such as # or $, or by the next mnemonic. If you have an HP-IB or HP-IL plotter, a line feed can also terminate an instruction. (Note that if you have an RS-232-C plotter, a line feed is not a valid terminator.) Some instructions will execute immediately after the mnemonic or last required parameter is received. When this is the case, the designation for the terminator is shown in parentheses in the syntax description. The syntax is shown on the next page.
*Option 001 provides 45 instructions; Option 002 provides 42 instructions;
Option 003 provides 41 instructions. Refer to the Plotter Instruction Set table in this chapter.
INSTRUCTION PARAMETER FIELD
MNEMONIC (AS REQUIRED) (AS REQUIRED)
J-^L I _J
Sep X Sep X Sep Parameter Sep Parameter Sep Terminator
OPTIONAL SEPARATORS ^^ REQUIRED SEPARATOR
(0OR MORE COMMAS
AND/OR SPACES)
NOTE: The syntax implemented on the 7470 is extremely flexible and
differs from that used on other Hewlett-Packard plotters such as the
HP 9872. Therefore, any software written for the 7470 which takes ad-
vantage of its less rigorous syntax will not be able to drive most other
HP plotters. If software is to be used with other HP-GL plotters, the
more rigorous syntax of the HP 9872 plotter should be used.
XX Parameters (.Parameters) Terminator
INSTRUCTION '
OPTIONAL PARAMETERS
The 9872 syntax does not allow separators between the characters of the mnemonic. One comma must separate parameters. Only; or LF may be used as the terminator for HP-IB or HP-IL plotters, and only ; may be used as the terminator for RS-232-C plotters. In addition, pa­rameters requiring integer format may not contain a decimal point or decimal fraction. ■
Some instructions have optional parameters which, when omitted, assume a default value. In order to omit a parameter, all subsequent parameters in the same instruction must be omitted. The only excep­tion is the pen parameters in the HP-GL instruction, UC.
The label instruction, LB, is a special case; it must be terminated with
the label terminator character. This character defaults to the ASCII end-of-text character, ETX, whose decimal equivalent is 3. The label terminator may be changed from its default value using the define terminator instruction, DT.
The parameter fields must be specified in the format defined by the syntax of each respective HP-GL instruction. The format can be of three types:
1.
Integer Format — a parameter in integer format between —32 768.0000
and +32 767.9999. Decimal fractions of parameters which must be
integers are truncated. If no sign is specified, the parameter is
assumed to be positive.
FOR RS-232-C PLOTTERS
;OR LF FOR HP-IB OR
HP-IL PLOTTERS
1-6 GETTING STARTED
Mann
«itei
GETTING STARTED 1-7
^^tmm^timtmit^tmimi^iiiitmm
;
)
)
)
)
)
)
)
)
)
) ) )
) )
)
)
MlHiiiliHtfiilMiHiialli
MHWiE&i:^
mm
;
)
)
)
)
) ) )
)
)
;
)
)
J
)
;
)
2.
Decimal Format — a number between -128.0000 and 127.9999 with
) ) )
:>
)
)
)
)
an optional decimal point and decimal fraction with up to four significant digits. If no sign is specified, the parameter is assumed to be positive.
3.
Label Fields — any combination of text, numeric expressions, or
string variables. Refer to The Label Instruction, LB, Chapter 5, for a complete description.
Some instructions such as PA, PR, PU, and PD may have multiple parameters. Separators are required between these parameters. These optional parameters are shown in parentheses in the syntax descriptions.
The syntax shown under the description of each HP-GL instruction uses the following notations:
AfA/emonic
necessary parameter ( )
C....C
(...) terminator
(terminator)
The following table shows the 7470's HP-GL instruction set.
Instruction
AA
X,Y, arc angle (, chord angle)
AR
X,Y, arc angle (, chord angle) n
CA CI
radius (, chord angle)
CP
spaces, lines
CS
m DC DF
For readability, the mnemonic is shown upper­case and separated from the parameters and/or terminator.
All typeset items are required parameters. All items in parentheses are optional. Any number of labeling characters. Any number of X,Y coordinate pairs. ; or any nonnumeric or nonalphabetic character
such as $ or #, or the next mnemonic. LF is also valid for HP-IB and HP-IL plotters.
Terminator for an instruction which will execute after the last necessary parameter is received.
Plotter Instruction Set
Description
Arc absolute* Arc relative* Designate alternate set n Circle* Character plot Designate standard set m
Digitize clear
Set default values
Plotter Instruction Set (Continued)
Description
run, rise
DI DP DR
run, rise c
DT IM
e(,s(,p)) IN IP
Plx.Ply (, P2x,P2y)
IW
Xio,Yi0,Xhi,Yhi
C....C
LB LT
t(,l) OA
Instruction
Absolute direction Digitize point Relative direction
Define label terminator Input e, s, and p masks Initialize Input PI and P2 Input window Label ASCII string Designate line type and length
Output actual position
and pen status
OC
Output commanded position
and pen status
OD
Output digitized point
and pen status OE OF OI OO OP OS OW PA
x,y(,x,y(....))
PD
(x,y(,...))
PR
x,y(,x,y(,...))
PU
(x,y(,...))
SA
SC
Xmin,Xmax,Ymin,Ymax
SI
width, height
SL
tan 0
Output error Output factors Output identification Output options Output PI and P2 Output status Output window Plot absolute Pen down Plot relative Pen up Select alternate character set Scale Absolute character size Absolute character slant
(from vertical)
SM
c
SP
n
SR
width, height
ss
TL
tp(,tn)
UC
(pen,)x,y,pen(,...)
V
VS
XT YT
*Available only with Option 001 plotters that have the serial prefix number
2308A or higher.
'*Not available with Option 003.
Symbol mode c
Select pen Relative character size Select standard character set
Tick length
User denned character** Select velocity v X-axis tick Y-axis tick
1-8 GETTING STARTED
MMiiiHiiiitaMii
GETTING STARTED 1-9
warn
)
)
)
) ) ) ) )
)
) ) )
)
) ) )
)
) ) )
)
)
)
)
)
)
;
>
>
)
£low to Use the Examples in This Manual
The examples in this manual are designed primarily to show the use of ) the instruction with which they appear. New programmers are strongly A encouraged to enter and run all examples. When the example consists
of only a few HP-GL commands, these commands are listed in quotes. ) No line numbers or BASIC statements are included. The literal string
A
listed should be sent to the plotter; the quotation marks only serve to
J delimit the string and are included because many computer languages
~) define literal strings by placing them inside quotation marks. Do not
send the quotation marks to the plotter. Longer examples are given as programs or program segments in
) BASIC. The programs will run only if the plotter has been defined as
A
the system printer. Since the statement to do this is highly system-
dependent, it is not included (except in Chapter 8). Unless specific
) mention is made in the text, the BASIC used is that of the HP-83/85.
You may need to make slight changes in the BASIC statements for
)
them to run on your computer. You may also need an I/O ROM to
) obtain output from the plotter. Check with the nearest HP dealer or HP
Sales and Support Office. If you are operating in an RS-232-C environ-
) ment, you will need to establish handshaking protocol and include the
\ necessary device control statements in your program.
If you are programming in another language, substitute the output or
)
input commands of your language for the BASIC statements PRINT
) and ENTER. Change FOR...NEXT loops and replacement statements
(X = 3.14) to whatever statements are comparable in your language. All
) characters enclosed in quotes in the program listing must be sent to the
^ computer using output statements; in addition, some variables, which
are not included in quotes, may need to be sent. Refer to Chapter 9 for some examples of complete simple programs to
) send and receive information between the plotter and specific com-
puters in an HP-IB environment. The Interconnection Guide (07470-
90003) has some examples of sending HP-GL commands from specific
) computers; there are examples using RS-232-C, HP-IB, and HP-IL
interfaces in that document.
KMiUlEl DF terminator
No parameters are used; a numeric parameter will
cause error 2 and the instruction will not execute. A DF command sets the following plotter functions to the conditions
shown in the following table. PI and P2 are not changed.
Default Conditions
Function
Plotting mode Relative character direction Line type Line pattern length Input window Relative character size
Symbol mode Tick length
Standard character set Alternate character set Character set selected Character slant Mask value Digitize clear Scale Pen velocity
Label terminator
Chord angle*
*Applicable only to Option 001 plotters that have the serial prefix number
2308A or higher.
Absolute (PA) Horizontal (DR1.0) Solid line 4%
of the distance from PI to P2 Mechanical limits of plotter Width = 0.75% of (P2X - Plx)
Height = 1.5% of (P2y - Ply) Off
tp = tn = 0.5% of (P2X - Plx) for Y-tick
and 0.5% of (P2y - Ply) for X-tick SetO SetO Standard 0 degrees 223,0,0 On Off
38.1 cm/s (15 in./s) ETX (ASCII decimal equivalent 3) Set to 5 degrees for AA, AR, and CI
Conditions
The Initialize Instruction, IN
The Default Instruction, DF
tions to a predefined state.
)
f
<
lUaxl The instruction can be used to return the plotter to a known
)
state while maintaining the same settings of PI and P2. This assures
j that unwanted graphics parameters such as character size, slant, or
scaling are not inherited from another program but that the positions
) of Pi and P2 remain unchanged.
JlO GETTING STARTED
)
)
The default instruction, DF, sets certain plotter func-
The initialize instruction, IN, returns the plotter's graphics conditions to the initial power-on state by program control. This instruction has no effect on handshake protocol or the plotter's state (programmed on or programmed off) in an RS-232-C environment.
The instruction can be used to return the plotter to a known state at the beginning of a graphics program so unwanted graphics parameters such as character size, slant, and scaling are not inherited from another program. PI and P2 are set to power-on positions.
■tWlftyi IN terminator
GETTING STARTED 1-11
)
)
)
) )
)
)
)
) )
)
) ) )
)
) ) ) )
)
)
)
)
)
)
)
;
)
)
)
) ) )
>. I^HUMi'MIHli'l NO parameters are used; a numeric parameter will K.-—«-3
J cause error 2 and the instruction will not execute. I
) An IN command is the equivalent of switching the plotter off and then
"\ on again (except that conditions set by escape code sequences are not
changed in an RS-232-C environment). The initialize command sets the
) plotter to the same conditions as the default command and sets these
additional conditions.
)
v • The pen is raised. 1ft! ™^3
• The scaling points Pi and P2 are set to the points PI = 250,279 and ^~ "^
) P2 = 10 250,7479. ) • All HP-GL errors are cleared. Bit position 3 of the output status byte ifW' J| j
-v is set to true(l) indicating the plotter has been initialized. (This bit is 1 ) cleared by OS.) '
) • The setting of the US/A4 switch (for paper size) is read, thus
\ establishing the limits within which the pen can move (mechanical
hard clip limits).
T
El SJ
The Input Mask Instruction, IM
J HlwHHIillFlltl The input mask instruction, IM, controls the conditions ~N
under which HP-GL error status is reported, the conditions that can
' cause an HP-IB service request message, and the conditions that can
cause a positive response to an HP-IB parallel poll.
UWM With all three interface configurations (HP-IB, HP-IL, and RS- —*
232-C),
this instruction can be used to change the conditions under fT^~^~3
which HP-GL error status is reported. In an HP-IB system only, the
instruction is used to enable the plotter to send a service request «! r-—.
message when specified bits of the status byte are set, and/or enable a i^' J_3
positive response to a parallel poll under the conditions specified.
--" " " " \
"\ BJiJIiftl IM E-mask value (,S-mask value (,P-mask value))
(terminator) or
IM (terminator)
■9<JI:Ui1llllfl and P-masks are of no use and are ignored if present. The E-mask is H J , _
used by all three configurations. J5« ^Jj
The E-mask value specified is the sum of any combination.of the bit
values shown in the following table. When an HP-GL error occurs, the bit in the E-mask corresponding to the error number as shown below is
tested to determine if the error bit (bit 5) of the status byte is to be set
and the front panel
there is no way to ever determine if that error occurred.
In both
the RS-232-C and HP-IL configurations, the S-
ERROR
LED is to be turned on. If a bit is not set,
3
EH3
E-Mask
Bit Value
1 2 4 8
16
32
64
128
The default E-mask value of 223 (128 + 64 + 16 + 8 + 4 + 2 + 1) will specify that all errors except error 6 will set the error bit in the status byte and turn on the ERROR LED whenever they occur. Error 6 will not
set the error bit or turn on the ERROR LED if it occurs, since it is not included in the E-mask value. Errors 4 and 7 never occur so setting the E-mask to 151 will set the same conditions as the default value 223.
The S-mask value specified is the sum of any of the bit values shown below. It determines when a service request message will be sent. When
a bit of the status byte changes value, the status byte is ANDed with the S-mask in a bit-by-bit fashion to determine if bit 6 of the status byte is to be set and the service request message sent. The status of bit 6 changes as plotter conditions change, and is cleared or set as required.
S-Mask
Bit Value
1 2 4
8 16 32
64
128
For example, an S-mask value of 4 specifies that when a digitized point is available, setting bit 2, the service request message will be sent. Setting other bits will not send the service request message.
Bit
0
1 2 3
4 5 6
7
Error
Number
1 2 3 4 5 6
7
8
Status Bit
Number
0
1 2 3 4 5 6
7
Instruction not recognized Wrong number of parameters Bad parameter Not used Unknown character set Position overflow Not used Vector or PD received with pinch
wheels up
Pen down PI or P2 changed Digitized point available Initialized Ready for data; pinch wheels down
Error
Not used
Not used
Meaning
Meaning
12 GETTING STARTED
GETTING STARTED 1-13
)
)
)
) ) ) )
)
)
) ) )
)
)
)
)
) ) )
)
)
)
)
)
)
) )
) ) )
)
)
)
)
)
The P-mask value specifies which of the status-byte conditions will
)
result in a logical 1 response to a parallel poll over the HP-IB interface.
) )
) )
)
)
.)
)
) ) )
)
P-Mask
Bit Value
1 2 4
8
16
32
For example, a P-mask value of 48 specifies that only bits 4 and 5 (16 +
32) of the status byte can cause the plotter to respond to a parallel poll with a logical 1 on the appropriate data line.
The plotter, when set to default values or initialized, automatically sets
the E-mask to 223, the S-mask to 0, and the P-mask to 0. An IM command without parameters or with invalid parameters also sets the masks to the default values 223,0,0.
Status Bit
Number
0 1 2 3 4 5
Meaning
Pen down PI or P2 changed Digitized point available Initialized Ready for data; pinch wheels down Error
J
)
;
)
) )
) 1-14 GETTING STARTED
)
^
EE3
^3
Looking Ahead
Of course you want to use your plotter to create high quality graphic
plots.
Most plots fall into one of three broad classes: line graphs, bar graphs, or pie charts. Chapter 8 contains a discussion of a line graph. Shown below are a bar graph and a pie chart.
Pie charts are an effective way to show parts of a whole entity; the slices of the pie are the component parts. The pie chart here has some segments "exploded" for emphasis. To construct a pie chart, the data is computed as a percentage of the total and each data value is converted to the appropriate segment of a full 360-degree circle. A simple circle­drawing program is found under the PA instruction in Chapter 3. To create a pie chart you'll need to draw segments of a circle (arcs) and connect the endpoints of the arcs to the circle's center with plotted lines.
There are three types of bar graphs; simple bar graphs, stacked bar
graphs, and clustered bar graphs. The simple bar graph here shows that sales are increasing. Bar graphs are essentially a collection of rectangles; i.e., four plotted lines. Each of these rectangles is filled; refer to the ad­vanced programming tips
at the end of Chapter 8 to learn how to create a filled or hatched area. A
stacked bar might be used to show these same sales
data broken down into
sales by region. Portions
of each bar would be
colored or shaded differ-
ently to show the sales in
each region. Another way
of showing sales by region
would be to use a separate
bar for each region and
to "cluster" all the bars
for one year together with
a larger space between each cluster of is one cluster for each year of data.
bars.
There
3000
2500
I
a
2000
■5
1500
|
1000
i
SQQ
0
m.
SMITH UNIVERSITY
STUDENT ENROLLMENT BY COLLEGE
fORKTRT - I!
NET SALES
ml
JLL
1972
1971
III!
1973
1974 1975 1976 1977
GETTING STARTED 1-15
VETERINARY SCIENCE - 21
LAW - S*
AGRICULTURE - IB
1
M.
1
1
1979
1978
Ml
19B0
;
)
,)
) )
)
^
)
)
)
)
) ) )
)
)
)
)
)
')
) ) )
) ) )
)
> )
) ) )
Chapter
Establishing Boundaries
and Units
What You'll Learn in This Chapter
In this chapter you will learn about the plotting area, how to define a point in this area, and the two kinds of units used to describe the plot­ting area. After reading this chapter, you will be able to decide which units to use for your data. In addition, you will be able to scale the plotting area into user units appropriate for your data, and to set or read the current scaling points. You will be able to restrict plotting to only a portion of the plotting area, and read the current limits of the
plotting area.
HP-GL Instructions Covered
IP The Input PI and P2 Instruction
OP The Output PI and P2 Instruction
SC The Scale Instruction
IW The Input Window Instruction OW The Output Window Instruction
Terms You Should Understand
Scaling — dividing the plotting area into units convenient for your ap­plication. Units need not be the same physical size in both axes, nor do there need to be an equal number of units in the X- and Y-axes.
Scaling Points — the points on the plotting surface moved to when the front panel buttons user-unit values specified by the parameters of the scaling instruction SC.
Window — that part of the plotting area in which plotting of points, lines,
and labels can occur. At power on, the window is set to the mechanical limits of the plotter. Nothing can be drawn outside the current window.
Clipping — restricting plotting to a portion of the plotting area by establishing a window of a certain size.
P1
and P2 are pressed. These points are assigned the
ESTABLISHING BOUNDARIES AND UNITS 2-1
)
3
:>
)
)
)
.)
)
) )
>
)
) )
) ) ) )
)
)
)
-")
)
)
)
)
)
.)
)
)
J
)
?he Plotting Area
The plotting area is that area of the paper in which the pen can draw.
)
The maximum plotting area for the HP 7470 Plotter is 191 X 272 mm
)
(7.5 X 10.7 in.) when the paper switch is set to A4, and is 191 X 257 mm (7.5 X 10.2 in.) when the paper switch is set to us. These plotting areas
)
permit plotting on either metric A4 size paper or English paper and allow for a margin beween the plotting area and the edges of
)
the paper.
)
The plotting area should be thought of as a two-dimensional Cartesian coordinate system. Remember, in a two-dimensional Cartesian coordi­nate system, a point is defined by its X- and Y-coordinates; for example, 200,300 represents a distinct point where X = 200 and Y = paper is loaded, the orientation of the X- and Y-axes is established as shown in the following diagram. When looking at the plotter from the front, the origin is located near the upper-left corner of the paper. From
now on, we will refer to that corner as lower left, since when a plot is viewed, the minimum point is generally at the lower-left corner of the plot.
8'/2-by-l
300.
1-inch
When
Unit Systems
There are two unit systems which can be used to define points in the
plotting area: plotter units and user units. Plotter units are always the same size. The size of a user unit depends on the parameters of the SC instruction and the settings of the scaling points, PI and P2.
The Plotter Unit
The plotting area is divided into plotter units; one plotter unit equals
0.025 mm. There are approximately 40 plotter units per millimetre, or approximately 1000 plotter units per inch. One plotter unit is the
smallest move the plotter can make. When the paper switch is set to A4, the plotting area contains 10 900 plotter units in X and 7650 plotter
units in Y. When the paper switch is set to us, the plotting area contains 10 300 plotter units in X and 7650 in Y. While the pen can only plot in the area mentioned above, parameters of plot commands be­tween —32 768 and 32 767 plotter units are understood by the plotter. When plotting in plotter units, only integer values are used; parameters are truncated to integers. Refer to The Plot Absolute Instruction, PA, in Chapter 3.
- ) < )
, )
' )
1 (DEFAULT)
-,i
.-wmwmmwL>mmi^w,mL
+Y
+X
HARD CLIP
LIMITS
(DEFAULT) P2
Si 3
gkj
At power on, upon front-panel reset, and whenever an IN command is
sent to the plotter, the scaling point PI is set to 250,279 plotter units and the scaling point P2 is set to 10 250,7479 plotter units. These settings are independent of the setting of the paper switch.
User Units
The plotting area can also be scaled into user units. This is done with
the scale instruction, SC, which assigns values to the scaling points PI and P2. A user unit may be almost any size. The parameters of the SC
instruction are truncated to integers between -32 768 and 32 767.
Parameters of plot commands must also be in that range but may be decimal numbers with fractional parts. Decimal fractions are not trun­cated; as a matter of fact, you can set the scaling points at 0,0 and 1,1 and all your data can be decimal fractions between 0 and 1. You can also use the plot relative instruction to plot to a point which, in user units,
is beyond the range ±32 768 as long as its location, expressed as plotter units, is in range. Refer to the plot instructions PA and PR in Chapter 3. You will probably use the SC instruction and user units for most plots.
Setting the Scaling Points
Scaling points PI and P2 can be set programmatically using the input PI and P2 instruction, IP, as described in a following section. PI and P2 can be set manually using front panel controls ENTER, PI, and
P2.
of2
ESTABLISHING BOUNDARIES AND UNITS
)
ESTABLISHING BOUNDARIES AND UNITS 2-3
) ;
")
)
) )
)
)
)
)
)
)
)
)
) )
) ) )
)
)
)
)
)
) )
)
Loading...
+ 84 hidden pages