The Museum of HP Calculators

HP Forum Archive 01

[ Return to Index | Top of Index ]

Figuring out HP41 Barcode
Message #1 Posted by Steve on 25 Apr 1999, 5:53 a.m.

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.

      
Some specific questions
Message #2 Posted by Steve on 25 Apr 1999, 6:57 a.m.,
in response to message #1 by Steve

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?

      
I know I'm talking to myself but...
Message #3 Posted by Steve on 25 Apr 1999, 9:24 a.m.,
in response to message #1 by Steve

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

            
Re: I know I'm talking to myself but...
Message #4 Posted by Dan Grelinger on 25 Apr 1999, 10:31 p.m.,
in response to message #3 by Steve

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.

                  
Wow! I'm getting so close!
Message #5 Posted by Steve on 26 Apr 1999, 1:56 a.m.,
in response to message #4 by Dan Grelinger

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.

                        
Yes! Yes! Yes! (I'll have what she's having :-)
Message #6 Posted by Steve on 27 Apr 1999, 12:36 p.m.,
in response to message #5 by Steve

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.

                              
Re: Yes! Yes! Yes! (I'll have what she's having :-)
Message #7 Posted by Jerry Ballard on 28 Apr 1999, 12:49 a.m.,
in response to message #6 by Steve

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

                              
Re: Yes! Yes! Yes! (I'll have what she's having :-)
Message #8 Posted by Chuck Ratliff on 28 Apr 1999, 10:55 p.m.,
in response to message #6 by Steve

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

                              
I'll have what she's having - another order
Message #9 Posted by Andrew Burg on 12 June 1999, 12:15 p.m.,
in response to message #6 by Steve

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

I need that... What do I do? Andrew@Andrewsite.com 805-469-6714

                              
Re: Yes! Yes! Yes! (I'll have what she's having :-)
Message #10 Posted by Chris Catotti on 15 June 1999, 9:11 a.m.,
in response to message #6 by Steve

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


[ Return to Index | Top of Index ]

Go back to the main exhibit hall