Figuring out HP41 Barcode


I don't have the benefit of the book, so I'm doing this the hard way.

I've figured out the start/end codes for the barcode I've figured out the 0 to 9, '.', and backspace

I'm having trouble with the commands

I'm about to have a go at programs...

Any assistance would be greatly appreciated.


Program bars have 16 bytes (although I understand this is variable).

The first three bytes and the last byte are control information

The second byte appears to be always 1X where X is (row-1) mod 16. Is this 1 ever something else? Does it change for (say) private barcode?

The last byte is always 2F on the last row of the barcode. Why? I thought this might have been a checksum byte but apparantly not? What is it?

Or am I deluding myself? What comes before the 2F is the "END" which is coded as CC 04 (in this particular program). How are these END's coded again?

One of the other bytes must be the checksum. From memory the checksum is calculated by some method that involves rolling the byte left 1 bit between adds, but I can't remember (maybe the carry was what was reintroduced to the right of the byte -- it's been so long). Can anyone enlighten me?


OK, from lookin at some code for printing barcode, the following appears to be the case

byte 1 is the checksum (mod 255) 255 being used instead of 0. The checksum from one bar carries on to the next bar. bytes 2 to n are used in calculating the checksum.

Byte 2 is xy where x is 1 for normal, 2 for private, y is bar number mod 16 (zero based)

Byte 3 is something odd

Byte 4 to n is the code of the program (there's nothing special about the last byte)

But there must be something wrong here, becasue the checksum I calculate doesn't match the checksum on any barcode I have here :-(

Anybody can feel free at any time to put me out of my misery by posting the solution :-)


Byte 3 is divided into two four bit nibbles. The first nibble is the number of bytes on that card that belong to a function of which the first part is stored on the previous card. The second nibble is the number of bytes on that card that belong to a function of which the remainder is stored on the next card.


Thanks Dan for the information on Byte 3. I had figured from the code I have that it was something to do with that, but now I actually understand :-)

My progress so far:

I have an interface between my HP41 and my PC (my PC pretends to be the IR printer)

I can send ascii or binary info to the PC

I am currently preparing the barcode on the HP41 and sending it (as a byte stream) to the PC

The PC can successfully print usable barcode

BUT (damn!) For program barcode I'm getting checksum errors. I have not been really confident of the code for creating these. If anyone can tell me how it's done I'll be almost finished.

(well, after that is the direct PC to HP41 interface via the wand (but without printed barcode...)

Is anything ever finished? The HP41 is very slow at preparing the barcode. Eventually I'll just send the binary code for the program to the PC and let it do all of the barcode creation.


I can now print HP41 barcode successfully!

My problem was that I had accidentally allowed the barcodes to be longer than the wand allows (max of 16 bytes?)


Thanks to those who helped.


Steve, I just bought an HP41 HP-IL module and a HP-IL PC interface card. I have been reading your messages about the success you have had in getting this to work. Could you share all that you know about hooking these up and getting the HP41 talking to the PC. My first project is to get where I can store my HP41 programs on the PC HD or Floppy drive. Then be able to transfer them back to the HP41. Dan will understand my request. Then I am very interested in doing what you are doing, print HP41 bar code on my PC printer. Please send me an email. Thanks. Jerry


This really does look like a great tutorial in the making, maybe for 'permanent' posting in the guest contribution section. Thx. CR


Wow. Saving programs and printing barcode??!!!!

I need that... What do I do? 805-469-6714


Steve, Please contact me. I would very much like to print HP-41 Barcode from a PC.


Chris Catotti, PO BOX 621777, OVIEDO FL, 32762-1777

Work/Voice Mail: (407) 384-3913

Possibly Related Threads...
Thread Author Replies Views Last Post
  Updated PPC DVD Version 2.10: HP-41 Searchable Program Files and Scannable Barcode Jake Schwartz 3 828 09-27-2013, 09:51 PM
Last Post: Olivier (Wa)
  HP 41: new barcode creation tool MichaelG 50 4,910 07-17-2013, 02:09 AM
Last Post: Ángel Martin
  HP41 Barcode ideas MichaelG 6 1,036 07-15-2013, 08:59 AM
Last Post: Olivier De Smet
  What About An iOS/Android HP-41 Barcode Reader App? Jake Schwartz 0 448 07-10-2013, 10:39 AM
Last Post: Jake Schwartz
  HP 71b ZENWAND Barcode Reader - Manual Michael Fehlhammer 2 555 11-02-2012, 03:34 AM
Last Post: Klaus
  HP-41C clear cased barcode reader Keith Midson 7 1,118 05-21-2012, 08:10 AM
Last Post: aurelio
  Errors reading with a HP 82153A Barcode Optical Wand aurelio 22 2,399 04-04-2012, 05:19 PM
Last Post: Les Wright
  HP41 Barcode generation Raymond Wiker 18 1,894 10-29-2011, 02:14 PM
Last Post: Raymond Wiker
  HP-41C SKWIDBC Barcode Generation ROM aj04062 27 2,770 09-07-2011, 09:58 AM
Last Post: M. Joury
  OT: Blackberry LifeScan barcode capture hpnut 3 598 06-19-2010, 07:14 PM
Last Post: hpnut

Forum Jump: