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 oo82162A.news.txt
Note: afore using this program read the QPL public license in
- A brief description
- Prerequisites, Install and Run it
- Print data
- Output formats, on screen, on paper
- Controls of this program
- Manuals of the role model
- The fine print
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
Merely for nostalgic reasons I programmed a simulation of it using
ooREXX under Windows.
It connects by
to controllers like
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.
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
- open a command window, navigate to the directory where you installed oo82162A and
enter "oo82162A.rxh" (without quotes),
- start the windows explorer, navigate to the directory where you installed oo82162A and
double-klick oo82162A.rxh or right-click it and select open (suffix .RXH should be linked to RexxHide)
- single-click a shortcut link you prepared before.
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.
- An already running HP-82240A or -B simulation will prevent from launching another HP-82240A/B instance,
- if oo82162A started an IR printer simulation it will when ending also end all
HP-82240A and -B instances, no matter who started them,
- in contrast a V41 instance started by oo82162A will on purpose not be shut-down when oo82162A ends
(the emulated HP-41 may be useful also w/o printer),
- if V41 is enabled to source auto-IDY frames oo82162A may detect a closed loop of Virtual HPIL and
will indicate "loop sound" by enabling the PRT and ADV buttons,
- the a. m. automatism of launching either V41 emulator or the IR printer simulation (or both) will
most certainly fail if you run other programs as the intended using a window designation
beginning with "HP-82240" or use the window class #109,
- oo82162A is programmed for use with version B of the IR printer simulation.
It remains users' task to ensure this setting.
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 127.0.0.1 is ok.
In fact any IPv4 ID with 127 as first value will do.
See 'Internal host loopback address' in http://tools.ietf.org/html/rfc1122.
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 127.0.0.1 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.
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
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.
- which part of the program is called,
- messages received from the virtual loop,
- transitions of interface functions,
- local interface messages,
- work list of interface transitions,
- data received from HP-IL send to the device parser,
- data output via UDP,
- execution of device specific functions,
- error messages and 'almost error' messages.
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.
- 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.
- Option 'Cling V41+PR Windows' couples pop up of V41 and IR printer windows with oo82162A getting the focus.
- The 'Print' and 'Paper Advance' buttons are only operational with option 'Auto IDY Frames' marked in V41.
- The position of the oo82162A dialog window is saved in the registry
for to set its location on screen at next run.
- See also oo82162A.news.txt 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 hp41.org.
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:
THE Q PUBLIC LICENSE version 1.0
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
The Software and this license document are provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
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:
- Adapted IL Printer ROM
- Bar Code Sample
- Another UDP Receiver
Adapted IL Printer ROM
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
(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.
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
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
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 184.108.40.206. MF, 12.10.2014 */
/* replaced not chop 16 by substr 17-*. MF, 25.07.2018 */
dip = '172.18.23.33' /* 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' */
'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 */
Pushing the printer keys in programming mode.
* * * * * END OF FILE * * * * *