Creating SysRPL library to exchange data between 39G/40G series and 49G series



#2

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


#3

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


#4

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


#5

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.


#6

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


Possibly Related Threads...
Thread Author Replies Views Last Post
  Sheet data importer for HP Prime Marek Russ 4 480 11-15-2013, 04:55 AM
Last Post: debrouxl
  Library#4 Modules mass-update and New Overlays Ángel Martin 0 347 11-09-2013, 05:55 AM
Last Post: 'Angel Martin
  [HP Prime] Constants Library Values Timothy Roche 24 1,826 11-02-2013, 04:17 PM
Last Post: Les Koller
  [HP-Prime CAS] Vector Calculus Library CompSystems 7 755 10-31-2013, 12:48 PM
Last Post: Han
  Equation Library/App for the Prime Harold A Climer 3 429 10-30-2013, 10:14 AM
Last Post: CompSystems
  Entering,Saving,and Analysis /Fitting X Y Data on the Prime Harold A Climer 6 665 10-26-2013, 01:54 PM
Last Post: Tim Wessman
  Equation Library on the PRIME Harold A Climer 0 246 10-26-2013, 10:01 AM
Last Post: Harold A Climer
  HP-10C Series Family Photo Max Stone 5 600 10-24-2013, 10:31 PM
Last Post: Eddie W. Shore
  Creating an App, and evolution for the extreme beginner (me) Geoff Quickfall 4 481 10-20-2013, 01:27 AM
Last Post: Geoff Quickfall
  HP PRIME: How to change the column headers and reset data Joseph Ec 5 547 10-18-2013, 02:26 PM
Last Post: Joseph Ec

Forum Jump: