The Museum of HP Calculators

HP Forum Archive 16

[ Return to Index | Top of Index ]

Creating SysRPL library to exchange data between 39G/40G series and 49G series
Message #1 Posted by Marcus von Cube, Germany on 27 Oct 2006, 4:53 a.m.

Here is another posting I'vre recently made in comp.sys.hp48:

Quote:
Hello friends!

As a computer professional and hobbyist, I've spent considerable time in writing communication software, from serial lines to TCP/IP, RMI, MqSeries, SNA and the like.

It's time to do it again in a completely foreign environment (at least for me).

I plan to create a library for the 39G/40G (should work on the 39GS/40GS, too) which enables the user to transfer assorted items (real and complex variables, lists, arrays, matrices, notes) from the calculator to another calculator of a different family, that is, the 49G series (49G, 49g+, 50g). Transfers should be possible in both directions.

Connections can be made in the following ways:

  • 39G/40G to 49G: RS232 unit to unit cable (10 pin)
  • 39G to 49g+/50g: IrDA (is that possible or are protocols different?)
  • 39GS/40GS to 50g: 3.3V serial unit to unit cable (comes with 40GS!)
  • 39GS to 49g+/50g: IrDA.
  • 39GS/40GS to 49g+/50g: USB (unit to unit cable as provided with some TI calcs).

The protocol should be XMODEM. I think the best transfer mode will be ASCII but the SysRPL gurus here might think different (are these machines using the same binary representation?). ASCII mode has the advantage of a universal transfer header ("%%HP" if I remember correctly.)

I was able to send a note from my 40GS to the 50g with the supplied cable. It arrived as a string object with binary contents on the 50g, still containg the 39G header. There is no way yet to use the data or to transfer something back.

I can't start with my little project because I'm missing crucial information on the topic. I have no idea of the following:

  • How do I select and configure the communication port ?
  • Can I use the built in XModem routines or do I have to create my own?
  • If I have to implement XModem myself, how do I access the communication port(s)?
  • Can USB be used in a peer-to-peer fashion ?

A good starting point could be some SysRPL source. I found some programs by Jean Yves Avenard to exchange data between a 48G and the 38G (http://etud.epita.fr/~avenar_j/hp/38.html). They are just the binaries. In order to get started, the source code would be a gem! I hope I can learn something about communication programming from the XMODEM server for the 38G!

I've skimmed through hundreds of pages of SysRPL documentation and tutorials but have yet to create my first program. I'm pretty sure I will if the community comes up with some hints...


This is the only answer (by John H Meyers) I've go so far:
Quote:
On Thu, 19 Oct 2006 11:08:34 -0500, Marcus von Cube wrote:

> I plan to create a library for the 39G/40G (should work on the 39GS/40GS,
> too) which enables the user to transfer assorted items (real and complex
> variables, lists, arrays, matrices, notes) from the calculator to another
> calculator of a different family, that is, the 49G series (49G, 49g+, 50g).
> Transfers should be possible in both directions.

> The protocol should be XMODEM. I think the best transfer mode will be ASCII.

The 49G series already has a completely built-in capability to send and receive source-text-based files using Kermit protocol; the Conn4x USB-based software also permits ascii transfer using the calcs' built-in "Xmodem server," but if that system relies on a piece of software which Conn4x must first send in binary to the calc, then you'll likewise need to install a program or library into the 49-50 series calc before talking to any other Xmodem-based device for ascii transfer, whereas no additional software is currently required for ascii transfer using Kermit (provided that it properly "negotiates down" at the outset to accept the dumbest original level of Kermit capability).

If you do create a new similar library, you might want to consider protecting against any transferred text being directly executed as commands instead of stored (the last Conn4x I've used would execute all transferred text as if entered into the command line -- if it happened to produce an object that could be stored into a legally named variable, fine; if instead it executed and produced nothing left over to be stored, then not only would the calc obey and perform any commands sent to it, but the procedure also produced an error and did not complete the restoring of flag settings in the calc).

Various suggested means for doing this have been posted and can be searched at Google Groups if you can access that (currently we can not).

Best wishes from http://www.mum.edu and http://www.maharishischooliowa.org


Essentially, all my questions are still waiting for an answer.

Marcus

      
Re: Creating SysRPL library to exchange data between 39G/40G series and 49G series
Message #2 Posted by Tim Wessman on 27 Oct 2006, 8:38 a.m.,
in response to message #1 by Marcus von Cube, Germany

You've run into the same problems I have in the past: you want to program something neat, but there are pieces of information missing nobody but the designers know. . .

The objects internally are encoded same as the 48/49 series. The hardest piece of writing code for the 39s is getting everything into an aplet. There just isn't much documentation about how to do it. . . :-(

I really don't know about xmodem/asc on the unit. I think i remember JYA saying once that most of the internal flags were similar. Trial and error may be the only way to go.

USB can't be used for calc to calc transfer.

TW

            
Re: Creating SysRPL library to exchange data between 39G/40G series and 49G series
Message #3 Posted by Marcus von Cube, Germany on 27 Oct 2006, 9:48 a.m.,
in response to message #2 by Tim Wessman

Quote:
USB can't be used for calc to calc transfer.
I've read somewhere that the USB port is of the "USB on the go" type which allows one partner to play the role of a USB host. At least the TI machines seem to allow this. My TI USB calc-to-calc cable has one connector labled "A" and one labeled "B" so the way I plug the cable in decides which calc plays which role.

Marcus

                  
Re: Creating SysRPL library to exchange data between 39G/40G series and 49G series
Message #4 Posted by the person formerly known as dot on 27 Oct 2006, 11:06 a.m.,
in response to message #3 by Marcus von Cube, Germany

Sorry, but the HP port is NOT 'USB on the go'.

However, in theory, it may be possible to program one calculator as a master and one as a slave. This is because the ARM chip has USB master hardware internally. The problem is there is no software support for it at all. You'd have to write a driver.

                        
Re: Creating SysRPL library to exchange data between 39G/40G series and 49G series
Message #5 Posted by Marcus von Cube, Germany on 28 Oct 2006, 4:00 a.m.,
in response to message #4 by the person formerly known as dot

Writing a driver is out of reach, I've never dealt with the innards of USB...

My secret plan is to enable the 40GS to talk directly to a TI-84 via USB. The latter should support 'USB on the go' because the cable I'm talking about came with my TI-84+. Drivers for the TI protocol written in C are available. So in theory it should be possible to create software for the 40G that exchanges some kind of variables (lists, matrices) between these machines.

But I need a bunch of additional info before I can start.

Marcus


[ Return to Index | Top of Index ]

Go back to the main exhibit hall