The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

USB41 :: Linux/Unix version
Message #1 Posted by Geir Isene on 30 May 2012, 5:44 p.m.

Diego's wonderful USB41 module has just gotten a Linux/Unix upgrade :)

With this USB41 Ruby program, you can get the HP-41 to print to your Linux/Unix machine.

Simply run the program as root, and any printing from your HP-41 will go to Standard Out. To print whatever comes from the HP-41 straight onto the screen, simply run the program:

usb41

You can of course do all kinds of tricks on the PC side like piping the output or redirect it to a file, etc.

To print a program on the HP-41 to the file "myprogram.txt" on the PC, do:

usb41 > myprogram.txt

The program defaults to input from /dev/ttyUSB0, but you may specify another input device by simply adding it as an argument to the program:

usb41 /dev/ttyUSB1

Just make sure the program is "runable" (with "chmod a+x") and drop it in your "bin" folder of choice and you are ready to go.

Except for ending the program with a "Control-C" on the PC, you may also print the message "PREND", and the program will terminate (just enter "PREND" into Alpha and do XEQ"PRA")

You must have Ruby installed as well as "ruby-serialport" (on Ubuntu or Debian, do "sudo apt-get install ruby-serialport")

Edited: 30 May 2012, 5:52 p.m.

      
Re: USB41 :: Linux/Unix version
Message #2 Posted by Diego Diaz on 30 May 2012, 6:10 p.m.,
in response to message #1 by Geir Isene

Hi Geir,

That's great! Seems that you've found the time for things other than the wonderful Norwegian sky... :-)

Although I don't have a linux machine to run it; I'm pretty sure many users out there will find this a really valuable addition to the posibilities of the USB-41 printer simulation.

Thanks a lot for yet another improvement to the Clonix/NoV series funtionality.

All the best from Caribbean Sea.

Diego

            
Re: USB41 :: Linux/Unix version
Message #3 Posted by Ángel Martin on 31 May 2012, 12:59 a.m.,
in response to message #2 by Diego Diaz

Good news indeed, well done Geir - increasing the number of users will build momentum for a NORM/TRACE support :-) Please?

Cheers, 'AM

                  
Re: USB41 :: Linux/Unix version
Message #4 Posted by Geir Isene on 31 May 2012, 2:01 a.m.,
in response to message #3 by Ángel Martin

Quote:
...NORM/TRACE support :-) Please?

Yes, pretty-please?

                        
Re: USB41 :: Linux/Unix version
Message #5 Posted by Sylvain Cote on 31 May 2012, 7:08 a.m.,
in response to message #4 by Geir Isene

+1

      
Re: USB41 :: Linux/Unix version
Message #6 Posted by Sylvain Cote on 30 May 2012, 9:15 p.m.,
in response to message #1 by Geir Isene

Hello Geir,

After some minor modifications it also works on Mac OSX Lion.

First you need Xcode ...
a) download & install xcode 4.3.2 (app store)
b) download & install Xcode command line tools (xcode/preferences/download)

Second you need mac port c) download & install macport (http://www.macports.org/install.php) d) sudo port selfupdate e) sudo port upgrade outdated

Third you need Ruby + extensions f) sudo port install ruby g) sudo gem install ruby-serialport

Then the usb41 modifications ... ... require "rubygems" require "serialport" port_str = "/dev/tty.usbserial" ...

then just type

./usb41

or

ruby usb41

and it's working! 8-)

Sylvain

            
Re: USB41 :: Linux/Unix version
Message #7 Posted by Geir Isene on 31 May 2012, 2:00 a.m.,
in response to message #6 by Sylvain Cote

Thanks :)

Update; I just tweaked the code slightly so that those who have with ruby-serialport installed via RubyGems (not only Mac users) will not have to go in and change the code.

To use it on a Mac without any code change, you may use the new version like this:

./usb41 /dev/tty.usbserial

or

ruby usb41 /dev/tty.usbserial

Updated version available from the OP link above.

Edited: 31 May 2012, 2:56 a.m.

            
Re: USB41 :: Linux/Unix version
Message #8 Posted by Geir Isene on 31 May 2012, 10:06 a.m.,
in response to message #6 by Sylvain Cote

Updated the script again.

                  
Re: USB41 :: Linux/Unix version
Message #9 Posted by Sylvain Cote on 31 May 2012, 10:28 a.m.,
in response to message #8 by Geir Isene

New script tested and working perfectly on OSX.

Thanks!

Sylvain

                        
Re: USB41 :: Linux/Unix version
Message #10 Posted by Diego Diaz on 31 May 2012, 2:26 p.m.,
in response to message #9 by Sylvain Cote

Hi all,

And thanks a lot for your effort in expanding the platform range available for the USB-41 interface module.

I know the lack of a TRACE (see below on NORM) mode in the current implementation of the HP-82143A is a major drawback, and I'm working to overcome such limitation; regerettably, I have not the time nor the tools in my current location but will try my best with available resources. It may take a few weeks though, since I'm "officially" on vacation from next Monday ahead... ;-)

My last idea is about using the "doble width" printing flag (useless in the simulator) to switch from MAN to TRACE mode. Suggestions and comments are welcome as usual.

I'll keep you posted on any advance regarding this issue.

All the best from Dominican Republic.

Diego.

NOTE: As far as I can tell NORM mode is just intended for paper saving purposes, which has not much sense on a "virtual" printer. Please correct me if I'm wrong but I think that TRACE & MAN modes will be enough to fulfil the text printing needs.

                              
Re: USB41 :: Linux/Unix version
Message #11 Posted by Geir Isene on 31 May 2012, 4:41 p.m.,
in response to message #10 by Diego Diaz

TRACE is the one I need.

                                    
Re: USB41 :: Linux/Unix version
Message #12 Posted by Ángel Martin on 1 June 2012, 1:56 a.m.,
in response to message #11 by Geir Isene

+1

                              
Re: USB41 :: Linux/Unix version
Message #13 Posted by Sylvain Cote on 31 May 2012, 4:52 p.m.,
in response to message #10 by Diego Diaz

Hello Diego,

The following describe how I use the thermal printers today.

a) for program listing I use the MAN mode (left align) or the TRACE mode (compact). For the USB-41 module, MAN mode is the mode that I will use.

b) for program execution the 3 modes have their own advantages
MAN = print functions only
NORM = input values, displayed values, fncs keys & print fncs
TRACE = NORM with program steps as they are executed

Currently, I use the 82143A/82162A printers either MAN or NORM modes most of the time and TRACE mode when debugging is needed.

Also, I am using the NORM/TRACE mode of the 82143A with the HP-IL Dev Module in SCOPE mode. When set to 1.5 sec delay, all HP-IL RAW MSG are printed to the thermal printer. Very handy for understanding how IL devices behaves on the interface loop.

Having the NORM and/or TRACE mode(s) added to the module will be great. But then again, the current implementation of the USB-41 is very convenient for me and covers most of my needs.

Best regards,

Sylvain

                                    
Re: USB41 :: Linux/Unix version
Message #14 Posted by Diego Díaz on 31 May 2012, 9:26 p.m.,
in response to message #13 by Sylvain Cote

Hi Sylvain,

Thanks for the details on the different printing usage.

In its final version, the 82143A simulation should allow user to select any of the three modes. Howevevr, it will need a new firmware including bidirectional transfer, which has not been developed yet.

In the meantime I'm trying to find a suitable workaround using unidirectional transfer.

For users who prefer the TRACE mode, I can send a replacement file "Clonix-P.asm" with fixed TRACE mode.

Although "off topic" I still remember your issue with Double X-MEM emulation, and think I've got a (temporary?) fix: just proceed to [MEMORY LOST ] after inserting your NoV-64/Clonix-D; it has worked for me even at 372KHz.

I confess I found this by accident and have only a guess on why it happens but hope this is also usefull for you, and any other user interested in trying the Double X-MEM configuration.

Best wishes from the Tropic of Cancer.

Diego.

Edited: 31 May 2012, 9:31 p.m.

                                          
Re: USB41 :: Linux/Unix version
Message #15 Posted by Sylvain Cote on 31 May 2012, 11:07 p.m.,
in response to message #14 by Diego Díaz

Hello Diego,

I knew that for now only unidirectional communication was available, but I did not expect that you needed bidirectional capability to implement the two other modes. So I was out of line and I am sorry for that.

Trace mode fix already available! Wow that was fast! Yes I am interested :-)

I will try your X-MEM fix with both modules (Clonix-D and NoV-64) this week-end and come back to you with the result.

Since nobody seemed to use this feature and it understandably had a low fix priority, I have bought on eBay 4 X-MEM modules that will be modified to become 2 Double X-MEM modules.

Thanks for everything and I wish you great vacations!

Best regards,

Sylvain

                                          
Re: USB41 :: Linux/Unix version
Message #16 Posted by Geir Isene on 1 June 2012, 3:07 a.m.,
in response to message #14 by Diego Díaz

Please send the TRACE mode fix with instructions on how to upgrade. Thanks.

      
Re: USB41 :: Linux/Unix version
Message #17 Posted by Geir Isene on 1 June 2012, 6:53 p.m.,
in response to message #1 by Geir Isene

Permanent link to the script "usb41" under "Other tools" on the UC-41 calculator page.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall