HP Forums

Full Version: Figuring out HP41 Barcode
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

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?)

Cool!

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? Andrew@Andrewsite.com 805-469-6714

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

Thanks!

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

kd4ace@compuserve.com

Work/Voice Mail: (407) 384-3913