Go to the first, previous, next, last section, table of contents.


Known HP-GL commands

hp2xx originally emulated a subset of the Hewlett-Packard 7550A plotter. The following manual was used as reference for command definitions: [1] HP 7550A Interfacing and Programming Manual. This has gradually been expanded to include almost all of what is now known as HPGL/1, and most of the commands from HPGL/2.

Not all commands are supported. Among the non-supported commands are those which do not really apply to a software emulator, like:

commands affecting the communication between plotter and host computer,
commands for changing the behaviour of a real plotter, like plotting speed etc.,
commands for the control of plotter memory allocation,
commands causing various plotter display outputs.

Other non-supported commands would be desirable, but were left out due to their inherent complexity (or just because nobody had an immediate need for them yet).

Programmers intending to add more HP-GL features should ideally take care to implement the less-than-obvious side effects of existing commands on the new features, too (and vice versa). E. g., line types (LT;) affect most but not all drawing commands: While the ER; command (edge rectangle relative) uses the current line type, its counterpart EA; (edge rectangle absolute) always draws solid lines. However, both PR; and PA; use the current line type! In addition, new features may need initializations by the already supported codes IN; or DF;, so these may have to be expanded.

The remainder of this section lists all HP-GL commands given on pages 1-2 to 1-4 of [1] and marks them as either

      (.)  not applicable,
      (-)  ignored, or
      (+)  supported.

The label "supported" is used when I think the command is fully supported in the context of the already implemented commands. In general, you should have absolutely no problem with this class of commands.

Though there still are unsupported commands, this does not mean that you might have trouble using hp2xx. Nowadays, most HP-GL files are machine-generated, e.g. by CAD or DTP programs. These tend to make use of just a subset of HP-GL. To my experience, chances are high that hp2xx will give you the picture you want! (Areas where hp2xx is definitely lacking are font support and polygon fills, but even there you should get a good approximation of what a plotter would produce).

HP-GL|s n| Description & Remarks
Cmd  | i |
=====|===|========================================================
AA   |+  | Arc Absolute
AC   |+  | Anchor corner
AD   |*  | Alternate font Definition
AF   |+  | Advance Full page [same as PG]
AH   |+  | Advance Half page [same as PG]
AP   |  .| Automatic pen operations
AR   |+  | Arc Relative
AS   |  .| Acceleration select
AT   |+  | Arc through three points
-----|---|--------------------------------------------------------
BP   |+  | Begin Plot
BL   |+  | Buffer Label
BR   |+  | Bezier curve, Relative
BZ   |+  | Bezier curve, Absolute
-----|---|--------------------------------------------------------
CA   |+  | Designate alternate character set
CC   | - | Character Chord angle
CF   | - | Character Fill mode
CI   |+  | Circle
CM   |  .| Character selection mode
CO   |+  | File comment
CP   |+  | Character plot
CR   |+  | Color Range
CS   |+  | Designate standard character set
CT   |+  | Chord tolerance
CV   |  .| Curved line generator
-----|---|--------------------------------------------------------
DC   |  .| Digitize clear
DF   |+  | Default
DI   |+  | Absolute direction
DL   | - | Define downloadable character
DP   |  .| Digitize point
DR   |+  | Relative direction
DS   | - | Designate character into slot
DT   |+  | Define label terminator
DV   |+  | text Direction Vertical
-----|---|--------------------------------------------------------
EA   |+  | Edge rectangle absolute
EC   |  .| Enable paper Cutter
EP   |+  | Edge polygon
ER   |+  | Edge rectangle relative
ES   |+  | Extra space
EW   |+  | Edge wedge
-----|---|--------------------------------------------------------
FI   | - | pcl Font ID
FN   | - | pcl secondary Font Number
FP   |+  | Fill polygon
FR   | - | FRame advance
FS   |  .| Force select
FT   |+  | Fill type
-----|---|--------------------------------------------------------
GC   |  .| Group count
GM   |  .| Graphics memory
-----|---|--------------------------------------------------------
IM   | - | Input error reporting mask
IN   |+  | Initialize
IP   |+  | Input P1 and P2
IR   |+  | Input Relative P1 and P2
IV   | - | Invoke character slot
IW   |+  | Input window
-----|---|--------------------------------------------------------
KY   |  .| Define key
-----|---|--------------------------------------------------------
LA   |*  | Line Attributes
LB   |+  | Label
LM   | - | Label mode (for two-byte character sets)
LO   |+  | Label origin
LT   |+  | Line type
-----|---|--------------------------------------------------------
MC   | - | Merge Control
MG   |+  | Message [same as WD]
MT   |  .| Media Type
-----|---|--------------------------------------------------------
NP   |+  | Number of Pens
NR   |  .| Not ready (unload page and go offline)
-----|---|--------------------------------------------------------
OA   |  .| Output actual position and pen status
OC   |  .| Output commanded position and pen status
OD   |  .| Output digitized point and pen status
OE   | - | Output error
OF   | - | Output factors
OG   |  .| Output group count
OH   | - | Output hard-clip limits
OI   |  .| Output identification
OK   |  .| Output key
OL   | - | Output label length
OO   |  .| Output options
OP   |+  | Output P1 and P2
OS   | - | Output status
OT   |  .| Output carousel type
OW   |+  | Output window
-----|---|--------------------------------------------------------
PA   |+  | Plot absolute
PB   |+  | Print buffered label
PC   |+  | Pen Color
PD   |+  | Pen down
PE   |+  | Polyline Encoded
PG   |+  | Page feed
PP   | - | Pixel placement
PR   |+  | Plot relative
PS   |+  | Plot Size
PT   |+  | Pen thickness
PU   |+  | Pen up
PW   |+  | Pen Width
-----|---|--------------------------------------------------------
QL   |  .| Quality Level 
-----|---|--------------------------------------------------------
RA   |+  | Fill rectangle absolute
RF   | - | Raster Fill pattern
RO   |+  | Rotate coordinate system
RP   | - | Replot
RR   |+  | Fill rectangle relative
RT   |+  | Relative arc through Three points
-----|---|--------------------------------------------------------
SA   |+  | Select alternate character set
SB   | - | Scalable or Bitmap font selection
SC   |+  | Scale
SD   |*  | Standard font attribute Definition
SI   |+  | Absolute character size
SL   |+  | Character slant
SM   |+  | Symbol mode
SP   |+  | Select pen
SR   |+  | Relative character size
SS   |+  | Select standard character set
ST   |  .| Sort vectors
SV   | - | Screened Vectors
-----|---|--------------------------------------------------------
TD   | - | Transparent Data
TL   |+  | Tick length
TR   | - | Transparency mode
-----|---|--------------------------------------------------------
UC   |+  | User-defined character
UF   | - | User-defined fill type
UL   |+  | User-defined line type
-----|---|--------------------------------------------------------
VS   |  .| Velocity select
-----|---|--------------------------------------------------------
WD   |+  | Write to display
WG   |+  | Fill wedge
WU   |+  | pen Width Unit
-----|---|--------------------------------------------------------
XT   |+  | X-Tick
-----|---|--------------------------------------------------------
YT   |+  | Y-Tick


Go to the first, previous, next, last section, table of contents.