The HPPrint Project

Why and how

Sometimes hard copy is needed for HP computers or instruments, but no HP-IB printer or plotter is available. In that case an emulation using a common GPIB interface card might be a proper substitute. Also, an emulator can be used to produce file output instead of a paper hard copy, which might be better suited for further processing.

Background: Printer History

In the early days, the user interface between a computer and a human in many cases had been a teleprinter or teletypewriter, sending typed input to the computer, and printing the response. Later those were replaced by terminals with keyboards and CRT output.

CRTs had a lot of advantages, however, having a hard copy still was required for certain applications. For example, sometimes input and output for system administrators needed to be logged, so that every admin activity could be traced. In that case the system console was a printer with integrated keyboard, and the printouts got archived for the sake of documentation.

Early Printers

As computers became faster and more powerful, there also was a need for mass printing. One of the first mass printers which were available with commercial computers was the 1952 UNIVAC High Speed Printer from Remington Rand.

Remington Rand High Speed Printer

Remington Rand UNIVAC High Speed Printer from 1953

The UNIVAC High speed Printer was capable to print content from magnetic tape roughly at the speed of the computer, with up to 600 lines per minute on a line 130 characters wide. The character set covered a total of 51 numbers, letters and punctuation marks. The printer was designed to print on continuous sprocket-fed paper from 4" to 27" overall width.

For each of the 130 character positions a type wheel was mounted on a continuously revolving shaft, plus a hammer which could be individually driven against the type wheel over an inked ribbon and/or special carbon paper. This type of printer with revolving type wheels is also known as a drum printer.

For more basic requirements, Remington Rand also offered the Uniprinter model with a standard electric Remington typewriter as printing mechanism. The Uniprinter could directly be connected to a magnetic tape reader. Both high speed printer and Uniprinter belonged to the family of so-called impact printers.

Following the UNIVAC, every mainframe and mini computer familiy featured its own high speed printer models. Another quite popular printing mechnism was that of a chain printer with a fast rotating type chain, and a hammer for every character position on the line. In 1970, also Hewlett Packard introduced the 2614A, a high speed printer based on a drum printing principle with nearly identical technical characteristics as the UNIVAC high speed printer (rotating drum, up to 600 lines/minute, 132 characters/line, character set with 64 characters standard) for the HP 2100 and HP 3000 mini computer families.

HP 2614A

HP 2614A Line Printer

Nearly at the same time Hewlett Packard also introduced another completely different type of printer with electrostatic printing for a completely different application, the HP 9100A desktop calculator. More like the printer of a cash register. Later, HP started developing a large number of different printer models for diverse applications. The two most important models probably were the 2686A LaserJet in 1980, and the 2225A ThinkJet in 1983. Both models built the foundation of HP's later success in the printer industry, and finally helped HP surviving the large die out in the computer industry during the 1990s.

Outside of HP, there were at least two printer models which also have been important milestones. The first one had been a miniature printer introduced in 1968 by Shinshu Seiki Co., a subsidiary of Suwa Seikosha Co., Ltd.

EP-101

EP-101 Printer

The EP-101 was an impressive piece of technology. When introduced, it was the smallest and lightest printer of the time. The printing principle was quite similar to those of the early high speed printers, a type drum spread over a full line of 21 characters, and hammers were driven over an ink ribbon against the paper and the drum. Later Shinshu Seiki began branding their printer products as EPSON, which simply stands for 'son of EP'. EPSON printers started to dominate the market of the dot matrix printers. Probably best selling product was the EPSON MX-80, which was also OEMed by IBM as 5152 Graphics Printer for its Personal Computer.

The early printers were specialized on type printing and not capable to print graphics. Nevertheless, lots of effort was spent to use the different average black coverage of each character to create posters and banners with large prints, where each halftone picture element was represented by the character with the appropriate black coverage plus overprinting (ASCII Art):

ASCII Art

ASCII Art

Plotters

Real graphics applications in the early days of course used plotters for hard copy. I am not sure what the very first commercial plotter was, since the idea of moving a pen over a paper with two axis wasn't that hard to implement. Measuring instruments for example already used graphics recorders for printed results. For its UNIVAC family Remington Rand offered a plotter based on a oscilloscope, which could be coupled with a Polaroid camera to create vector images. In 1959, the Californian company Calcomp specialized on mechanical plotters (drum plotters).

Hewlett Packard originally started with graphics recorders for their measuring instruments with the acquisition of the F Mosley company, which later built HP's San Diego division specialized on flatbed plotters. HP's first real plotter was the 9125A which was introduced in 1968 and represented the foundational design for all later HP plotter models. Among those the 9872A was the first one which was controlled with a new, general purpose HP designed plotter language called HP-GL (for Hewlett Packard Graphics Language) which became industry standard for vector graphics and still plays an important role as part of HP's Printer Command Language (PCL).

HP 9125A Plotter

9125A Plotter (Courtesy HPMuseum)

Anyway, with the thermal, dot matrix, inkjet and finally laser print technologies, graphics were no longer the exclusive domain of plotters. All four technologies allowed single dot addressing and printout. In the early years, when memory was quite expensive, it was not possible to create random full page graphics within the printer just by sending proper commands like HP-GL or Postscript. It was simply not possible to have a buffer large enough to hold a full page with millions of dots. Rather, bitmaps had to be created on the computer (as far as the memory allowed) and then to be sent in 'stripes' as a stream of bytes to the printer. Consequently, the main graphics application for printers became hard copies of the computer screen.

Desktop Printers

With the start of the home computer market in 1977, of course there also was a demand for low cost printers. Home computer owners were quite creative in re-using diverse printing facilities for their equipment, like electric typewriters or teletypewriters. For instance, the Apple-1 (introduced 1976) sometimes was used with the SWTPC PR-40 dot matrix printer, which could print at 25 lines/minute and was available for $250.

SWTPC PR-40

SWTPC PR-40 Printer

One of the most curious printing devices was the Seikosha GP-80 dot matrix printer from 1982, which used a single hammer to produce a 5 by 7 character matrix over a line of 80 characters at a rate of up to 30 characters/second. The single needle was just moved quickly up and down to produce every column of a character matrix. The GP-80 probably was one of the cheapest 80 characters/line printers ever built.

HP's first printers with graphics capabilities were the 9866B thermal printer (introduced in 1972), the dot matrix printer 2631G (1977) and the inkjet printer 2225A ThinkJet (1984). The 2225A ThinkJet was the first printer implementing HP's new Printer Command Language (PCL). HP's first laser printer was the 2680A which was introduced in 1980 for the price of $108,500. The 2680A was based on a Canon print engine and was capable of printing up to 45 pages/minute. It could be equipped with up to two megabytes of raster memory, which was enough to store full page graphics. Anyway, graphics still were rendered on the computer as individual raster images, and then sent with position to the laser printer.

Laser printer technology was quite new, and (among other groundbreaking innovations) was invented in 1972 at Xerox PARC by Gary Starkweather. Starkweather's idea was to couple the Xerox photocopier technology with a laser beam directly "writing" the exposure information on the copier drum. The prototype was called EARS (Ethernet, Alto Research character generator, Scanned laser output terminal), and later became the Xerox 9700 Laser Printer. Xerox soon started building laser printers on the base of diverse copier engines for different application purposes.

HP 2686A LaserJet

HP 2686A LaserJet Printer (HPMuseum)

With the 2686A LaserJet HP introduced 1984 one of its most significant products ever and was the first in the long line of HP LaserJets. The LaserJet was the first laser printer intended for the mass market. It was originally sold for reasonable $3,495 and was very reliable. Sales exceeded by far expectations, although the only interface was RS232, and there was not enough memory installed to print full page graphics, which was reserved for the next LaserJet model, the LaserJet Plus. The original LaserJet implemented PCL 3 (aka Level III), whereas the LaserJet Plus implemented PCL 4 (aka Level IV).

Background: PCL

HP once defined their HP-IB bus as the standard way to connect peripherals. The HP-IB bus had been designed to match all the requirements, it was fast, responsive, reliable, easy to use and efficient.

The probably first HP-IB printer was the 1975 9871A daisy wheel printer. Later several impact and thermal printers were equipped with an HP-IB interface. The last printer model with HP-IB interface probably was the 2225A ThinkJet printer (featuring inkjet technology).

The early HP-IB printers used a mix of HP-IB messages and escape sequences for printer control. For instance, in order to signal ready-for-data or service request, early HP-IB printers used parallel poll, SRQs with serial poll, and status reporting via secondary commands and escape sequences. Remote reset was possible with IFC, SDC, secondary commands and again escape sequences. So, for full emulation of those printers, all those mechanisms have to be implemented also in the emulation. However, in fact only the escape sequences and just a few HP-IB messages are really used by most HP computers and programs, since programming escape sequences showed to be more comfortable than programming the HP-IB.

The set of implemented escape sequences differs among the different printer models, but the codes used are almost the same. With the ThinkJet printer, HP decided to standardize their set of escape sequences as the so-called Printer Command Language (PCL). So, PCL 1.0 practically is represented by the set of escape sequences implemented in the 2225A ThinkJet printer.

Together with PostScript, PCL became the standard, hardware independent printer language. PCL continuously developed over the time until 1995. The current version is PCL 6 and still supported by all HP printers.

The HPPrint Program

In combination with a GPIB (also known as IEEE-488) interface board, this program works as an emulator for vintage HP printers. Currently supported models are:

HP2631G impact graphics printer (default)
HP9876A thermal graphics printer
HP2225A inkjet printer (PCL 1.0)
HP82905B dot matrix printer

HPPrint does not implement a full HP-IB printer emulator with command language interpreter, rendering and printing, but rather works as a grabber copying all data from the GPIB to the console or into a file for further processing.

HPPrint also does all the necessary messaging, handshake and status handling (including status reporting) between the computer or instrument and the emulated printer.

Most escape sequences are passed through transparently. Only those escape sequences which are required for messaging, handshake and status handling are effectively implemented. So the normal use of HPPrint is either to use HPPrint for logging, or to combine HPPrint with another program which renders the PCL output into another format.

If used for logging (or similar) applicatons, HPPrint provides the option to filter all PCL commands and most control characters, so that just the plain ASCII characters and the control characters for positioning (BS, CR, LF, TAB, VT, FF) are printed (typewriter mode).

HPPrint normally continuously listens to the HP-IB/GPIB bus. It can be triggered to automatically forward the data received from the computer or the instrument to a local system printer under certain conditions. Same applies to automatic program termination (useful if you use batch scripting). So, HPPrint is continuously collecting the print data from the GPIB bus, until one of the supported conditions occur, and then sends the data to a connected printer or terminates, depending on the selected mode.

As valid printing or termination conditions the following can be selected:

  1. No activity for a specified number of seconds
  2. Receiving the form feed control character (FF)
  3. Receiving the end of transmission control character (EOT)

You may choose either to print the recived data to a local system printer, or to exit HPPrint, or both. Typically, a form feed character signals end of page, and HPrint sends the data for a full page to a connected printer, and end of transmission signals that no more print data should be expected, so that HPPrint may end its operation and stop. This, however, of course depends on the application which is sending the print data to HPPrint.

HPPrint also can be used to grab whatever kind of data from the HP-IB/GPIB bus when being addressed, as long as no special messaging is required beyond that for HP-IB printers.

System Requirements and Installation

HPPrint should work under all 32-bit Windows version (Windows 9x and ME) as well as 64-bit Windows (Windows XP and above) and with most available ISA and PCI/PCIe GPIB/IEEE-488 interface boards.

Linux is not yet supported.

HPPrint needs additional drivers installed in the following cases:

In all other cases, HPPrint will run without any additional drivers.

Supported GPIB hardware

Currently supported are

HPPrint directly accesses the hardware registers, so be careful in using multiple instances of HPPrint on the same GPIB hardware or in using other drivers in parallel.

Using the Command Line Interface

Getting started

No installation is required for using HPPrint within Windows 9x/ME.

Using the GPIB feature under Windows NT/2000/XP/Vista/7/8/10 may require additional drivers, depending on the board type installed. National Instrume ts PCI-GPIB controllers can be used both with the original NI 488.2 drivers and with the custom TNT4882/TNT5004 driver. You should use the original NI driver unless you also plan to use the HPDrive utility. In case you have a NEC uPD7210 or TMS 9914 comptible board installed, you need to install the PortIO driver package in order to access ISA boards under Windows NT/2000/XP.

Once everything is configured, HPPrint can be started without any additional parameters:

hpprint

HPPrint then shows a message which kind of printer is emulated and on which GPIB address the emulation is listening. Default emulation is a 2631G impact printer.

Use CTRL-C to terminate HPPrint.

Printer activity may be monitored during runtime using the -d command line switch. During operation, the total number of data bytes received is displayed.

HPPrint can be tailored with several options. Use hpprint /? or hpprint -h to show an overview.

You may list the supported printer models with

hpprint -presets

Select one from the list e.g. with

hpprint -2225A

for selecting the ThinkJet.

To change the standard GPIB address to other values than the default 1 use

hpprint -a <gpib-address>

if you have more than one GPIB boards installed, use

hpprint -scan

to list all detected boards, and select from that list the board you want to bind HPPrint to another board than board 0, e.g.

hpprint -board 1

By default, HPPrint outputs all data to the console. If you need to save all print data into a file instead, use

hpprint <filespec>

to write the data into a file. Of course you also may simply redirect the output:

hpprint > <filespec>

Normally, computers or instruments send character data which is mixed up with control codes, escape sequences and binary data (e.g. for graphics). If you need to extract just the net characters without any control information and binary data, use

hpprint -t

which filters out all control information.

if you like to forward all print data to a local system printer, use

hpprint -printers

to show a list of all available printers, and select one from the list by either using the printer's name in double quotes, or (more comfortable) just specify the index from the list, e.g.

hpprint -autoprint <seconds> -p "Generic / Text Only" <filespec>

or

hpprint -autoprint <seconds> -p 3 <filespec>

for the 3rd item in the list. Note that <filespec> is mandatory, because HPPrint needs the name of a temporary file where it can write the data coming from the GPIB to. HPPrint will start printing automatically after <seconds> of inactivity. Please note that when selecting the printer by its name, it has to be exactly the name returned by hpprint -printers, including blanks and special characters, all within double quotes and case sensitive. Otherwise the printer will not be found.

HP programs sometimes terminate their print outputs with form feed or end of transmission control characters. In addition to the inactivity timer, you may use FF or EOT to tell autoprint when to send the file to the local printer, e.g.

hpprint -autoprint FF

sends the print data at the form feed character, whereas

hpprint -autoprint EOT

send the data to the local printer when receiving the EOT character.

The same triggers (timeout, FF, EOT) can also be use to terminate HPPrint with the auto exit feature, for example:

hpprint -autoexit 10
hpprint -autoexit FF
hpprint -autoexit EOT

Note that there is just one choice (cannot be combined).

If you just want to send an existing file with print data to the local printer (without grabbing it from the GPIB) you can do so e.g. to printer "Generic / Text Only" with

hpprint -lpr -p "Generic / Text Only" <filespec>

For further processing the data collected by HPPrint, you may use third party filters to create more useful outputs, e.g. you might use the GhostPCL utility to convert PCL output to (almost) everthing else, including PDF documents or PNG images:

hpprint myfile.pcl
gpcl6win32 -sDEVICE=pdfwrite -o myfile.pdf myfile.pcl
gpcl6win32 -sDEVICE=pngalpha -o myfile.png myfile.pcl

Below is a summary of all commands. Execute HPPrint with the -h option for a summary. Also have a look into the README file for up-to-date information.

Command Description
-<model>

select emulated printer model (use -presets for list)

Currently supported are:

-2631G (HP2631G impact graphics printer) (default)
-9876A (HP9876A thermal graphics printer)
-2225A (HP2225A inkjet printer) (PCL 1.0)
-82905B (HP82905B dot matrix printer)

-a <address> GPIB primary address of emulated printer (0-30, default 1)
-board <board> select board from installed GPIB hardware list
-l <loglevel> 0=quiet 1=warnings 2=info 3=trace 4=debug (default 1)
-lf <logfile> log all output into <logfile>
-d display runtime printer activity
-t use typewriter mode (filter control sequences)
-v show version info
-p <printer> output to system printer <printer> (use with -autoprint)
-lpr send <filespec> to <printer> as raw data (similar to UNIX lpr)
-printers list available system printers
-autoprint EOT|FF|<sec> output to system print spooler on EOT, on FF, or after <sec> seconds inactivity
-autoexit EOT|FF|<sec> auto exit on EOT, on FF, or after <sec> seconds inactivity
-license show license info
-presets list supported printer models
-scan list detected GPIB hardware in your system
-port <port> specify I/O port base address for GPIB hardware

Restrictions

Implementation is somewhat basic, so don't expect all possible printer control codes to be handled correctly. Not much specifc is implemented concerning the individual implementations of the supported printer models, but the base line should be working for all supported models.

9871A is very specific in terms of special control codes which did not make their way into the PCL standard and therefore is not supported yet.

Downloads

Click here for downloading the HPPrint emulator:

HPPrint emulator 1.0 beta package: hpprint-10beta.zip
Custom TNT4882/TNT5004 Driver 3.2 for 32-bit and 64-bit Windows XP/Vista/Windows7/8/10: gpibdrv-32.zip
Custom PCMCIA GPIB/GPIB+ Driver 1.0 for 32-bit and 64-bit Windows XP/Vista/Windows7/8/10: pcmcia-gpib-10.zip
Custom PortIO Driver 1.0 for 32-bit Windows 2000/XP/Vista/Win7: portiodrv-10.zip
   

This first beta version may still have a couple of bugs. Please use the contact feature to let me know if something doesn't work as expected.

The free GhostPCL conversion utility can be downloaded here.

Troubleshooting

If nothing happens when forwarding printer data to a local system printer, this probably is caused by the fact that the printer cannot process the data. Try with the Windows Generic Text Printer to check your printer system.

More Information

<to be continued>