Description of the oo82162A REXX program

oo82162A simulates an HP-82162A 24 characters per line thermal printer connected by virtual IL. Output is send using UDP to HP82240B, a printer simulator, or other receivers. Graphics and bar code are feasible. Transliteration of RCL [ to RCL M and similar are optional.

Reasons for this release (11/1/21):
i) HP41's append text symbol now prints as "lazy T",
ii) in a talk-only/listen-only setup device starting sequence is now negligible,
iii) parse mode now functional (splits long lines on word boundaries).
For more see (in here).

Note: afore using this program read the QPL public license in section 8.


  1. A brief description
  2. Prerequisites, Install and Run it
  3. Connectivity
  4. Print data
  5. Output formats, on screen, on paper
  6. Controls of this program
  7. Manuals of the role model
  8. The fine print
  9. Supplements

A brief description

Some decades ago the Hewlett-Packard Company sold portable computing devices which connected printer, plotter, mass storage, measuring equipment, displays and more by a low-cost interconnection known as HP-IL. One of those devices was the 24 characters per line thermal printer HP-82162A.

Merely for nostalgic reasons I programmed a simulation of it using ooREXX under Windows. It connects by Virtual HP-IL to controllers like V41, Emu71, or Emu41 under DOSBox. Output is directed to an HP82240B Printer Simulator. Other receivers for print data are possible, see this example on z/VM.

Prerequisites, Install and Run it

To run oo82162A you need (in brackets what I used for the development):

To operate this virtual printer, you need either

To print graphic on the a. m. HP82240B simulation - which offers just as the role model two graphic columns less than the HP82162A - it is advantageous to use a modified IL Printer ROM.

Install it

There is no automated installation procedure. Unzip oo82162A.ZIP to a directory designated at will, a directory of its own or not, it's up to you. Depending on the way you like to run it, prepare one ore several shortcut links where you like to find them. There are neither arguments nor start options to run oo82162A. Instead all tailoring is done within an INI file.

First Run and Subsequent Runs

Open oo82162A.INI first using a text-only editor of your choice and modify it to your flavour. For further explanations see comments therein. In future this step is only necessary for changes.

Start oo82162A.rxh either by

Depending on your settings in the INI file start of oo82162A will optionally also launch HP-82240B IR printer simulation. It optionally also launches the V41 emulator.



oo82162A acts as a bridge from Virtual IL based on TCP protocol to an UDP datagram receiving printer simulation.

Connect to Virtual IL

oo82162A must connect to a Virtual IL (interface loop) to receive print commands from other devices (posts) within the same loop. As with HP-IL every device in the loop has a preceding and a following one. Connection to adjacent posts is made permanent by specifying port numbers in the oo82162A.ini file. Use a text editor of your choice to set the 'inport' number of the preceding post. In the settings or the preceding post the same number must be set there as out-port number.

Similar to the other side: the port number set in oo82162A.ini as 'export' must be used as in-port in the following post. The 'partner_dip' is the doted IP address of the computer running the following post. If it is the same one where you run oo82162A typically is ok. In fact any IPv4 ID with 127 as first value will do. See 'Internal host loopback address' in

Configuration of UDP Broadcast

Received print data is forwarded via UDP datagrams. Set in oo82162A.ini the IP of the machine on which the aimed receiver runs. If it is the same one where you run oo82162A typically is ok. Set the same UDP port as in the receiving program, if it does not match it will not work.

Ensure your firewall allows traffic on all a. m. ports.

Start first the emulation or simulation of those posts which do not source IL frames at power on (sniffers and devices). As last post start the controller to ensure the loop is closed before the first frame travels the loop.

For other possible settings see the hints in oo82162A.ini.

Print data

Printing for small, portable devices consist at most of program listings, calculation results, logs, trace output, what is character oriented data. The role model allowed also to print bar codes and graphics. The tests so far resulted in a modified IL printer ROM.

For examples see the manuals mentioned in section 7.

Note: when printing program listings in trace mode the HP-41 inserts every now and then for unfathomable reasons a blank line too much before labels. I try to handle it, the result looks good, alas the interpretation of print data conducts also unwanted deviations from the role model's behaviour. This elimination of too much blank lines may be switched off, see Menu/Options/interpret PRT data. To observe the effect of this option I suggest to print in trace mode programs like HP or IG of PPCROM with and without the option set. Two consecutive blank lines are filtered and in addition for consecutive labels the blank line before the second and following labels is omitted.

Output formats, on screen, on paper

There is no visible output of print data from oo82162A, neither on screen nor on paper. The only possible outputs is:
(i) error messages and execution trace when requested (shown in a command window), and
(ii) UDP datagrams, invisibly.

The UDP datagrams forward the print data formatted for an HP82240B Printer Simulator. Without it (or a similar receiver) you will not see any print output. To present what was send to be printed is sole task of the UDP receiver.

In the INI file you may allow several trace options to see

  1. which part of the program is called,
  2. messages received from the virtual loop,
  3. transitions of interface functions,
  4. local interface messages,
  5. work list of interface transitions,
  6. data received from HP-IL send to the device parser,
  7. data output via UDP,
  8. execution of device specific functions,
  9. error messages and 'almost error' messages.
I suggest to activate at least the last one. Other options may lead to a vast amount of log output. They could be convenient when adapting the virtual HP-IL interface part for another device simulation.

Controls of this program

Keys: F1  - will show this help file (if you linked suffix HTM with a browser),
      F2  - displays the About information,
      F12 - or 's' (w/o quotes) shows the front panel,
      Alt - or F10 activate menu,
      Esc - ends the program.
Buttons: Same as role model (see note 2).
Mode group: Same as slider of role model.
Menu: Underscored letters indicate which key will launch the option when menu is activated
      File              - opens a sub-menu with just one item:
         Exit           - ends the program immediately
      View              - opens a sub-menu with following item:
         Front Panel... - show a front panel photo
      Options           - opens a sub-menu to pick:
         Balance Blank Lines - toggles evaluation of print data
                                (in trace mode only)
         Cling V41+PR Windows - toggles "pop up follows oo82162A"
         Transliterate FPRDs - toggles change of First Page Regster Designations
         TCP/IP...      - choose in and out ports and out address of
                            Virtual HPIL and UDP address and port
      Quit              - prints buffer if applicable and ends program
      Help              - opens a sub-menu with following items:
         About...       - displays information about this program
         In detail...   - same as F1 pushed.
System Menu: as last items it offers TCP/IP... and About...
	which do the same as the menu items described above.


  1. In trace mode the evaluation of print data eliminates some surplus blank lines. This could be favourable for printing HP41 program listings in trace mode.
  2. Option 'Cling V41+PR Windows' couples pop up of V41 and IR printer windows with oo82162A getting the focus.
  3. The 'Print' and 'Paper Advance' buttons are only operational with option 'Auto IDY Frames' marked in V41.
  4. The position of the oo82162A dialog window is saved in the registry for to set its location on screen at next run.
  5. See also within the ZIP bundle.

Manuals of the role model

The oo82162A simulator is programmed as close as possible to the two publications:
(i) HP82162A Thermal Printer Owner's Manual, HP, 1981, No 82162-90001, and
(ii) The HP-IL Interface Specification, HP, 1982, No 82166-90017
You will find both publications on the archive DVD offered at

I recommend to read the first one if you like to get an overview about the printer. The second is for those who like to build devices interfacing the HP-IL, virtual and others.

The fine print

(i) Do not use this program.
(ii) Any damage you cause with this program, intentional or by chance, is a violation of clause (i). Thus all consequences are completely at your own risk.
(iii) If you manage to improve this program you have to inform me as stipulated in following THE Q PUBLIC LICENSE (QPL).
(iv) In addition applies the QPL below:


Copyright (C) 1999 Trolltech AS, Norway.

Everyone is permitted to copy and distribute this license document. The intent of this license is to establish freedom to share and change the software regulated by this license under the open source model.

This license applies to any software containing a notice placed by the copyright holder saying that it may be distributed under the terms of the Q Public License version 1.0. Such software is herein referred to as the Software. This license covers modification and distribution of the Software, use of third-party application programs based on the Software, and development of free software which uses the Software.

Granted Rights

  1. You are granted the non-exclusive rights set forth in this license provided you agree to and comply with any and all conditions in this license. Whole or partial distribution of the Software, or software items that link with the Software, in any form signifies acceptance of this license.
  2. You may copy and distribute the Software in unmodified form provided that the entire package, including - but not restricted to - copyright, trademark notices and disclaimers, as released by the initial developer of the Software, is distributed.
  3. You may make modifications to the Software and distribute your modifications, in a form that is separate from the Software, such as patches. The following restrictions apply to modifications:
    a. Modifications must not alter or remove any copyright notices in the Software.
    b. When modifications to the Software are released under this license, a non-exclusive royalty-free right is granted to the initial developer of the Software to distribute your modification in future versions of the Software provided such versions remain available under these terms in addition to any other license(s) of the initial developer.
  4. You may distribute machine-executable forms of the Software or machine-executable forms of modified versions of the Software, provided that you meet these restrictions:
    a. You must include this license document in the distribution.
    b. You must ensure that all recipients of the machine-executable forms are also able to receive the complete machine-readable source code to the distributed Software, including all modifications, without any charge beyond the costs of data transfer, and place prominent notices in the distribution explaining this.
    c. You must ensure that all modifications included in the machine-executable forms are available under the terms of this license.
  5. You may use the original or modified versions of the Software to compile, link and run application programs legally developed by you or by others.
  6. You may develop application programs, reusable components and other software items that link with the original or modified versions of the Software. These items, when distributed, are subject to the following requirements:
    a. You must ensure that all recipients of machine-executable forms of these items are also able to receive and use the complete machine-readable source code to the items without any charge beyond the costs of data transfer.
    b. You must explicitly license all recipients of your items to use and re-distribute original and modified versions of the items in both machine-executable and source code forms. The recipients must be able to do so without any charges whatsoever, and they must be able to re-distribute to anyone they choose.
    c. If the items are not available to the general public, and the initial developer of the Software requests a copy of the items, then you must supply one.

Limitations of Liability

In no event shall the initial developers or copyright holders be liable for any damages whatsoever, including - but not restricted to - lost revenue or profits or other direct, indirect, special, incidental or consequential damages, even if they have been advised of the possibility of such damages, except to the extent invariable law, if any, provides otherwise.

No Warranty


Choice of Law

This license is governed by the laws of most of the remaining members of the European Union (if still existing).


List of supplements:

  1. Adapted IL Printer ROM
  2. Bar Code Sample
  3. Another UDP Receiver

Adapted IL Printer ROM

-- Plot of SN -- (image source 'heureka.gif' is missing) If you like to print graphics on the IR printer simulation you should be aware of the minikin but annoying difference between the printers 82162A and 82240B -- the later offers only 166 dot columns per line. With an HP41, virtual or real -- "virtual is real" 1 -- I suggest to change the IL Printer ROM 2 (the one built in the HPIL module) as follows (values in column 1..3 are hex):
 @     old  new  comment
 60D4  013  012  in user code
 60D5  010  019  in user code
 612F  018  016  in user code
 6276  0A8  0A6  in MCode
 66B9  0A8  0A6  in MCode
 67B0  085  086  first line in CAT 2
 6FFB  005  006  now version F
 6FFF  387  383  chksm

With V41-IL (that is V41 R9 or newer) you may use il2ir.mod from the oo82162A.ZIP file in lieu of the HPIL.mod.

Note: PPCROM routine "HP" (High resolution Plot) should be adjusted too if used in this V41-oo82162A-HP82240B setup. Otherwise the different line pitch is quite incommodious, cf. fig. 1 and 2 of "HP" description in PPCROM manual p. 188f.

-- Plot 1 using PPCROM routine HP -- (image source 'ppcrom hp.gif' is missing) -- Plot 1 using PPCROM routine HP -- (image source 'ppcrom hp2.gif' is missing)

1 -- Excerpt from 'Paradigm', performed by George Clinton (2005), written by Prince
2 -- The inquisitive hobbyist may also compare SKPCOL of HP 82242A Infrared Printer Module with my suggestion

Bar Code Sample

-- Bar Code produced with PRBC from Plotter ROM -- (image source 'BC.png' is missing)

Produced with program "PRBC" (see HP82184A Plotter Module Owner's Manual, Section 7, p. 136) and the HP82240B Printer Simulator. Works perfectly with the "Software-Defined Wand" of M. Hepperle, even if reduced in size by half (50% exactly, resize only as resample is not beneficial).
(This bar code is actual my "RNR" routine, Round Near R, to abridge arbitrary numbers to the nearest fraction of r. Example: Pi 4 RNR returns 3,2500 while Pi 8 RNR results 3,1250. "RNR" preserves one stack level, a. m. QPL V1.0 applies.)

Another UDP Receiver

Here an example of a home-made UDP sniffer (receiver and re-sender) for HP-82240A/B-printer data. It runs on IBM mainframes (or similar platforms) under z/VM using Fullscreen CMS scrolling like an ASCII terminal with OTTOSCR. Besides a log of UDP traffic it displays also an auto-scrolling print stripe (text only, no pixel graphics, a. m. QPL V1.0 applies).

/* SNFIR EXEC: show what's sent to the IR printer. MF 23.2.2013       */
/* with log of print stripe                                           */
/* new IP, old was MF, 12.10.2014                           */
/* replaced not chop 16 by substr 17-*. MF, 25.07.2018                */

   dip = ''               /* where to forward the traffic */
   pot = 5025                         /* port of receiver             */

   parse source . . sn st sm .        /* get fileID of this prgm      */
   if st = 'EXEC' then do             /* EXEC part starts here        */

/* define a vscreen to log and a window to show the print stripe      */
      'PIPE(sep ! end ?) CMS Q DISPLAY',
       '! spec a: w2 . /WIN DEF 82240A/ 1 print (a-4) picture z9',
         'nw /27 4 50 (POP VAR/ nw',
       '! append literal',
         'VSC DEF 82240A 200 27 1 0 (PRO G;',
         'WIN SHOW 82240A ON 82240A;',
         'WIN R 82240A 1;',
         'SET LOCATION 82240A OFF;',
         'SET BORDER 82240A ON (LEFT * TOP * BLUE;',
         'VSC CLE 82240A;',
         'VSC WRIT 82240A 1 1 0 (RES PRO RED H FIELD HP-82240A Printer;',
         'SET LOGFILE 82240A ON;',
         'VSC WRIT 82240A 0 0 0 (R H FIELD ',
       '! split ;',
       '! nfind DMSDEF920E',       /* do not mention 'already exists' */
       '! term',
       '! aggrc'

      'EXL' sn st sm sn 'REXX (PUSH'  /* make this file a REXX        */

/* Main process starts here                                           */
      say 'Waiting for datagrams ... (end with HALT)' /* almost ready */

      'PIPE(sep ! end ?)',
       '? immcmd halt',               /* Set up immediate command.    */
       '!a:gate',                     /* Terminate when get HALT.     */
       '? var dip',                   /* doted decimal IP address     */
       '! split .',                   /* de-compile                   */
       '! spec w1 d2c 1.1 r',         /* convert                      */
       '! join *',                    /* compile                      */
       '! spec pad 00 x02 10 /' pot '/ d2c n.2 r *-* n.12 l',/* 4 UDP */
       '!b:not fanout',               /* deliver copy to 2ndry first  */
       '!c:dam',                      /* ensure JUXTAPOSE is set up   */
       '?b:',                         /* from NOT FANOUT              */
       '!d:juxtapose',                /* loop back                    */
       '!e:udp 5025 asyn',            /* datagrams to and from PC     */
       '!a:',                         /* GATE of IMMCMD               */
       '! substr 17-*',          /* keep columns 17 through last only */
       '!f:fanout',                   /* make copies                  */
       '! elastic',                   /* prevent a stall              */
       '!c:',                         /* DAM until juxtapose is ready */
       '!d:',                         /* to JUXTAPOSE                 */
       '?e:',                         /* errors from UDP              */
       '!g:chop blank',               /* keep RC only                 */
       '! aggrc',                     /* set RC                       */
       '?f:',                         /* from FANOUT                  */
       '! spec tod c2t(*) 1.15 r 1 c2x nw 1 nw',    /* time and trace */
       '! roman8 -1',                 /* make it readable             */
       '! term',                      /* to CMS at best with OTTOSCR  */
       '?f:',                         /* from FANOUT                  */
       '! rexx' sn,                   /* special treatment            */
       '?g:',                         /* from CHOP                    */
       '! strip',                     /* no blanks                    */
       '! term'                       /* show it                      */

        'EXD' sn 'REXX'               /* remove REXX from storage     */

   end                                /* end of EXEC part             */
   else do                            /* REXX starts here             */

      'AddPipe (endchar ?)' ,         /* Pre-process input stream..   */
       ' *.input:' ,                  /* ..for this stage.            */
       '! change x04 x0A',            /* care for PRGM listings' EOL  */
       '! deblock linend 0A',         /* take 0A as line end          */
       '! change 1.2 x1BFC x20',      /* make it a .bl                */
       '! roman8 *-* 86 B3',          /* ASCII to EBCDIC basically    */
       '!*.input:' ,                  /* Connect to ourselves.        */

      Do Forever                      /* Do until get EOF.            */
         signal on error              /* way out from Do Forever      */
         'READTO prilin'              /* Get next print line.         */
         address 'CMS'                /* next is not meant for Pipes  */
         signal off error             /* do not quit in case of error */
         "VSC WRIT 82240A 0 0 0 (PRO BLANK FIELD" prilin   /* "print" */
         "WIN B 82240A"; "WIN BA 82240A"; "WIN N 82240A"; "PSC REF"
         address                  /* previous destination of commands */
      End                             /* Forever                      */

   end                                /* end of REXX part             */

   EXIT RC                            /* that's it                    */

-- output of SNFIR -- (image source 'snfir.gif' is missing) Pushing the printer keys in programming mode.

* * * * * END OF FILE * * * * *