Post Reply 
Little explorations with HP calculators (no Prime)
03-18-2018, 12:27 PM
Post: #281
RE: Little explorations with HP calculators (no Prime)
(03-18-2018 12:14 PM)3298 Wrote:  Sounds quite similar to the function slots on the Casios so far, though I'd like to know if the TIs' # operator is as crippled as the Casios' functions, i.e. can it be used to call full-blown programs with loops and all the fancy things, or does it only permit a single value-returning command?

Indeed you can. Assuming you have one such full-blown program with loops and all the fancy things called fancyprg() then you can invoke it indirectly:

Code:
"fancyprg"->s
#s()

You can also use multiple levels of indirection:

Code:
"fancyprg"->s1
"s1"->s2
#(#s2)()
Find all posts by this user
Quote this message in a reply
03-18-2018, 12:50 PM
Post: #282
RE: Little explorations with HP calculators (no Prime)
One again, 3298 and grbanks, thanks for sharing!

I have seen also that the casiocalc.org may go down this summer. That's another pity, sigh.

http://community.casiocalc.org/topic/775...entry61632
Quote:I agree but the current very old shared hosting on which this site is hosted doesn't allow this. Anyway my host is ceasing all operations in July (I learned this 2 week ago) so we will have to change of provider anyway. I may switch to a VPS, I don't know yet... The switch will be painful in any case most of the PHP code is 15 years old... and this version of IPB is completely outdated, Maybe I should find someone with more time and motivation than me. I've been keeping this website on life support but I havent been involved with it for many years now...

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
03-20-2018, 11:59 PM (This post was last modified: 03-22-2018 02:19 AM by brickviking.)
Post: #283
RE: Little explorations with Casio 9750/9860 calculators
The Casio 9750/9860-based family have Lists, which are basically single-dimension arrays of numbers, up to 999 per list (or 255 for older versions). They also have Files, which have 6 Lists (9750g+) or 26 Lists (9750gII/9860gII). Here's how I use them to emulate the behaviour of "local" variables.

I stash a complete copy of the global variables A-Z, Theta and r, into a List. I generally use the last List on the calculator in the last File so it's less likely to get in the way of already-created Lists. I can then use the variables any way I like, because I then restore the copy I stashed aside when I've finished. I never bothered using Matrix functions, as I find the existing List behaviour works for me, at least for now.

Hm, when did this particular conversation get derailed from HP explorations? :/ Wink

(Post 192)

Regards, BrickViking
HP-50g |Casio fx-9750G+ |Casio fx-9750GII (SH4a)
Visit this user's website Find all posts by this user
Quote this message in a reply
03-21-2018, 10:45 AM
Post: #284
RE: Little explorations with HP calculators (no Prime)
(03-20-2018 11:59 PM)brickviking Wrote:  The Casio 9750/9860-based family have Lists, which are basically single-dimension arrays of numbers, up to 999 per list (or 255 for older versions). They also have Files, which have 6 Lists (9750g+) or 26 Lists (9750gII/9860gII).
I wanna throw in a few more numbers: AFX has 20 lists per file (and if I recall correctly, it allows 999 items per list), and there are 6 files on every Casio I've seen. The 9860 series also adds a list label (basically a string) as List n[0], but I can't remember if that existed before OS 2.0 or only after.
(03-20-2018 11:59 PM)brickviking Wrote:  Here's how I use them to emulate the behaviour of "local" variables.

I stash a complete copy of the global variables A-Z, Theta and r, into a List. I generally use the last List on the calculator in the last File so it's less likely to get in the way of already-created Lists. I can then use the variables any way I like, because I then restore the copy I stashed aside when I've finished. I never bothered using Matrix functions, as I find the existing List behaviour works for me, at least for now.
Plenty of people do that, but it breaks down when the program you're calling does the same on exactly that list (and the last list in file 6 is quite commonly used for that purpose), because the list cannot really be operated as a stack, so the called program will overwrite the caller's saved variables.
That may be one of the reasons for the absence of a (math, science, whatever) library ecosystem like the ones we have for the various calculators from HP. There are plenty of interactive math / science programs, but you can't use them as subroutines that way.

(03-20-2018 11:59 PM)brickviking Wrote:  Hm, when did this particular conversation get derailed from HP explorations? :/ Wink
... I think that happened when pier4r started comparing HPs to Casios and TIs; the helpful Casio and TI calculator owners in this forum jumped in and provided him with information to satisfy his curiosity. But let's get back on track, shall we? Smile
Find all posts by this user
Quote this message in a reply
03-21-2018, 11:23 AM
Post: #285
RE: Little explorations with HP calculators (no Prime)
(03-20-2018 11:59 PM)brickviking Wrote:  Hm, when did this particular conversation get derailed from HP explorations? :/ Wink

(Post 192)

There is no derailment. It is always useful to know the differences.

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
03-21-2018, 08:37 PM (This post was last modified: 03-21-2018 08:50 PM by pier4r.)
Post: #286
RE: Little explorations with HP calculators (no Prime)
So it is the first time (or maybe not, but I do not remember the previous time, if there was one) I connected two hp 50g to my win XP thinclient.

The problem is, if I connect with the connectivity kit to one system, then I disconnect and I try to connect to the other, it doesn't work.

Procedure.
hp 50g A , Xm server activated
conn4x, connect
it works.
conn4x disconnect (it stops the server on the 50g A)
hp50g B, Xm server activated
conn4x connect
problems
hp50g B, Xm server deactivated
hp50g A, Xm server activated
conn4x connect
it works.

If I reset the usb hub (I disconnect it for a while) and then I connect first the hp 50g B, it is the same result, only the 50g B works, not the 50gA.

The 50g-s are connected to the same usb hub, that is connected to one usb port on the system.

How do I get the second 50g working? This because I want to test something and I need parallel execution to make it a bit faster (plus, even having pretty distinct sequences of RAND).

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
03-21-2018, 11:27 PM
Post: #287
RE: Little explorations with HP calculators (no Prime)
(03-21-2018 08:37 PM)pier4r Wrote:  So it is the first time (or maybe not, but I do not remember the previous time, if there was one) I connected two hp 50g to my win XP thinclient.

The problem is, if I connect with the connectivity kit to one system, then I disconnect and I try to connect to the other, it doesn't work.

Procedure.
hp 50g A , Xm server activated
conn4x, connect
it works.
conn4x disconnect (it stops the server on the 50g A)
hp50g B, Xm server activated
conn4x connect
problems
hp50g B, Xm server deactivated
hp50g A, Xm server activated
conn4x connect
it works.

If I reset the usb hub (I disconnect it for a while) and then I connect first the hp 50g B, it is the same result, only the 50g B works, not the 50gA.

The 50g-s are connected to the same usb hub, that is connected to one usb port on the system.

How do I get the second 50g working? This because I want to test something and I need parallel execution to make it a bit faster (plus, even having pretty distinct sequences of RAND).

What does "Xm server activated" mean?

In you upper list, the sequence says that hp5g A connect and B does not, but just below that, you summarize "only the 50g B works, not the 50gA".

Which is correct? It's hard to follow the exact steps and results.

You are not trying to connect 2 50g machines to 2 instances of conn4x simultaneously are you?

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
03-22-2018, 02:16 AM (This post was last modified: 03-22-2018 02:17 AM by brickviking.)
Post: #288
RE: Little explorations with Casio 9750/9860 calculators
(03-21-2018 10:45 AM)3298 Wrote:  The 9860 series also adds a list label (basically a string) as List n[0], but I can't remember if that existed before OS 2.0 or only after.

It's on my gII but not on my g+. I'm pretty sure it's mentioned in the manual for all gII versions, including the 9750.

(03-21-2018 10:45 AM)3298 Wrote:  
(03-20-2018 11:59 PM)brickviking Wrote:  ... I generally use the last List on the calculator in the last File so it's less likely to get in the way of already-created Lists....

Plenty of people do that, but it breaks down when the program you're calling does the same on exactly that list (and the last list in file 6 is quite commonly used for that purpose), because the list cannot really be operated as a stack, so the called program will overwrite the caller's saved variables.

You could do it this way, store the Last-Used count in the first position of List6, and start counting from *LastUsed. It's sort of a stack, with the warning that you'd better reset the pointer when you've finished with it and presumably flush the variables too. That functionality could go into the "Clean-up" phase, though as you rightly point out, this won't work as well for calling subroutines. Consider it a bit like malloc/free pairs. Even if you use the full stride of 28 each time, you'd still end up with over 35 calls before you ran out of space in your stack.

If you get fiddly, you can sacrifice a slot each "segment" and use that to specify the size of the next segment, i.e. first one's 28, second one's ten, Listn[1] is how far to skip down for the first unused slot (LastUsed), Listn[2] is how large the first segment is before hitting another sement count.

Code:
All code refers to whichever Listn (List1..26) you're using for your stack.

Listn[1]=79,4i (LastUsed,Seg[ment]Cnt)
[2]=28 (Seg1Cnt)
[3]..[30] (Seg1)
[31]=10 (Seg2Cnt)
[32]..[41] (Seg2)
[42]=16 (Seg3Cnt)
[43]..[58] (Seg3)
[59]=20 (Seg4Cnt)
[60]..[79] (Seg4)
Pseudocode flows a bit like this:
  • Read First value.
  • peel off complex var portion (n), this tells me how many "segments" I stored.
  • from 1 to n
  • * Read value
  • * step forward that many to get next segment counter,
  • * increment n,
  • loop
  • Read final value

I can then restore that many variables. Yes, there are weaknesses in this, I haven't fully got my head around the aspects of shutting down programs in mid-stream without cleaning up the stack list.

(03-21-2018 10:45 AM)3298 Wrote:  But let's get back on track, shall we? Smile

This is fun, though I suspect this post could have gone into another forum.

(Post 193)

Regards, BrickViking
HP-50g |Casio fx-9750G+ |Casio fx-9750GII (SH4a)
Visit this user's website Find all posts by this user
Quote this message in a reply
03-22-2018, 11:15 AM (This post was last modified: 03-22-2018 11:26 AM by pier4r.)
Post: #289
RE: Little explorations with HP calculators (no Prime)
(03-21-2018 11:27 PM)rprosperi Wrote:  What does "Xm server activated" mean?

In you upper list, the sequence says that hp5g A connect and B does not, but just below that, you summarize "only the 50g B works, not the 50gA".

Which is correct? It's hard to follow the exact steps and results.

You are not trying to connect 2 50g machines to 2 instances of conn4x simultaneously are you?

Sorry I was not so clear (I thought I was).

Now I try to explain more clearly.

So I take my two 50g. (normally I use 1)
I connect them to the same usb hub.
I connect the hub to my windows XP system.
On win XP I start conn4x, I do nothing else.
On a 50g - doesn't matter which, I call it A - I start the Xmodem Server (before I shortened Xmodem with Xm)
in conn4x I see the 50g
in conn4x I can choose USB_calc and connect to it.
Then I disconnect conn4x
Xmodem server gets turned off on the 50g A as well
On the other 50g, say B, I start the Xmodem server.
I see the 50g in conn4x as "UBS_calc_1"
I try to connect to it: errors.

To connect to the 50g B, I should reset the usb hub (disconnecting it for a while from the power supply and from the usb on my computer) and then start the procedure above but connecting first the 50g B not the A.

I hope I was more clear now.


Side note: for my explorations so far - considering calculators that I can keep alive with a USB charger or that they have very low power drain - I consider my workflow as follow.
- For small numerical computations. sharp 506w (scientific calc with 2 line screen)
- For some bigger ones, the 9860G / GII are really easy to pick up and use without need to connect to the PC and type programs. Also the keyboard feels really nice, like the 506w. (graphing calc)
- for something a bit more elaborated, I need the keyboard but I use RPL on the 50g. (maybe I may use the 9860G for some tasks though, although what 3298 said is an eye opener)
- for something intensive that I want to park on fanless systems. HP prime. Developed on my test win10 environment, and computing on android.

I am struggling to decide if I need a 3rd 50g as backup of a backup (or when I need to save time with parallel computations).
Because the concept of the prime is amazing, as with a cheap android I get a computing environment. There are few other computing environment "productive" on different platforms. There is this or that interpreter but one has to be careful about which version is available and potential limitations. The prime is equal everywhere (if the platform is supported). Anyway the killer feature is to support android, that is mobile, silent and with powerful hw. Having multiple win/mac is not that easy or cheap.
With the 50g/RPL I have emulators, that are great but I don't like to simulate several layers of different instruction sets, but no real portable enviroment that I can use commonly available devices.

A strong competitor to the prime would be free42, that is available also almost everywhere. But while developing large stuff is possible, RPN for me is for small programs/formulas.

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
03-22-2018, 11:32 AM (This post was last modified: 03-22-2018 11:34 AM by 3298.)
Post: #290
RE: Little explorations with HP calculators (no Prime)
(03-22-2018 02:16 AM)brickviking Wrote:  
(03-21-2018 10:45 AM)3298 Wrote:  The 9860 series also adds a list label (basically a string) as List n[0], but I can't remember if that existed before OS 2.0 or only after.

It's on my gII but not on my g+. I'm pretty sure it's mentioned in the manual for all gII versions, including the 9750.
Yes, because the 9750GII is part of the 9860 series, as I've written before, and the 9750G+ is part of the old CFX series instead. Also, all GII models already come with OS versions >= 2.0.

(03-22-2018 02:16 AM)brickviking Wrote:  You could do it this way, -snip-
Nice idea, but if I recall correctly, there may be some problems with contents getting zeroed while resizing. (i'm not 100% sure as I last used a Casio many years ago, but I feel like there was something.) You might get around that using matrices which have a special command designed for augmenting without destroying the contents (aptly called "Augment"), but all this is a hell of a lot of work for something as essential as local variables.
Also, older calculators have some further limitations to work around: assigning dimensions directly errors on non-plus CFX calculators (... okay, those are ancient), but I'd expect at least Augment and the List->Mat, Mat->List combination to be usable as a workaround; trying to read a list element that doesn't exist (e.g. your size slot when the list is still empty) results in an error too, and writing past the end of the list to grow it is only supported on new calculators (I don't know if the AFX likes that, but the CFX clearly doesn't). Some of the RPL gurus might think that's not a big deal since they are accustomed to IFERR and friends, but errors cannot be caught on the Casios.

(03-22-2018 02:16 AM)brickviking Wrote:  I can then restore that many variables. Yes, there are weaknesses in this, I haven't fully got my head around the aspects of shutting down programs in mid-stream without cleaning up the stack list.
Right, since errors (including the interruption caused by pressing AC/ON) cannot be caught they may pose a little problem. Shouldn't be a huge deal though, since unless the error happens in the middle of this stack push/pop code the effect should be limited to just leaking memory like a C program that forgot to free a malloc'ed block. I'd consider it less of a problem than trying to convince other programmers to use that system over their own less sophisticated variable backup systems.

One limitation that hasn't been mentioned yet in this context is speed. Several of the missing features can be worked around, but the code to do so is very slow (and it fills the memory, which isn't exactly in ample supply either, since the AFX at 140KB is their only calculator with more than 64KB main memory).
I once wrote something resembling text input/output on the 9750G+. As a member of the CFX series it doesn't have strings, so I produced some giant If-Then-Else chains to translate keycodes+shiftplanes into some custom character encoding, as well as to output the corresponding character onto the screen. It was horribly slow, filling the screen with stored text took like a minute, and typing a single character took at least 1.5 seconds. The program also occupied more than half the memory of this calculator. Compare that to the HP48 series where you can simply take strings from the stack as input or leave them there as output at basically no cost. Or use something like PROMPT or INPUT if you insist on interacting with the user in the middle of the program.
Find all posts by this user
Quote this message in a reply
03-23-2018, 02:02 AM
Post: #291
RE: Little explorations with HP calculators (no Prime)
(03-22-2018 11:15 AM)pier4r Wrote:  Now I try to explain more clearly.

So I take my two 50g. (normally I use 1)
I connect them to the same usb hub.
I connect the hub to my windows XP system.
On win XP I start conn4x, I do nothing else.
On a 50g - doesn't matter which, I call it A - I start the Xmodem Server (before I shortened Xmodem with Xm)
in conn4x I see the 50g
in conn4x I can choose USB_calc and connect to it.
Then I disconnect conn4x
Xmodem server gets turned off on the 50g A as well
On the other 50g, say B, I start the Xmodem server.
I see the 50g in conn4x as "UBS_calc_1"
I try to connect to it: errors.

To connect to the 50g B, I should reset the usb hub (disconnecting it for a while from the power supply and from the usb on my computer) and then start the procedure above but connecting first the 50g B not the A.

I hope I was more clear now.

Why do you use 2 cables, why not simply disconnect 50g_A, then connect the same cable to 50g_B?

Also, IIRC, this is connecting through a thin client, right? Does the virtualized USB support pass-thru of the USB hub you've connected? Can you try connecting multiple other devices thru the same hub simultaneously, e.g. 2 USB thumb drives to verify the hub and dual connections?

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
03-23-2018, 08:20 PM
Post: #292
RE: Little explorations with HP calculators (no Prime)
(03-23-2018 02:02 AM)rprosperi Wrote:  Why do you use 2 cables, why not simply disconnect 50g_A, then connect the same cable to 50g_B?

Also, IIRC, this is connecting through a thin client, right? Does the virtualized USB support pass-thru of the USB hub you've connected? Can you try connecting multiple other devices thru the same hub simultaneously, e.g. 2 USB thumb drives to verify the hub and dual connections?

Honestly I was hopying to avoid too much connect/disconnect physical actions, as then I could just transfer things through the SD card.

The thinclient is "thin" only because it has relatively low ram for today standards, 1 gb. Otherwise yes, I connect to it several usb peripherals without problems.

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
03-25-2018, 05:01 PM
Post: #293
RE: Little explorations with HP calculators (no Prime)
while searching around I found.

http://ftp.ftp.hpmuseum.org/

Is it still used?

No ideas about "simultaneous" use of the 2 50g-s ? If I am lucky I get a third for a reasonable price, with warranty.

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
03-25-2018, 07:34 PM
Post: #294
RE: Little explorations with HP calculators (no Prime)
(03-25-2018 05:01 PM)pier4r Wrote:  while searching around I found.

http://ftp.ftp.hpmuseum.org/

Is it still used?

No ideas about "simultaneous" use of the 2 50g-s ? If I am lucky I get a third for a reasonable price, with warranty.

Well... you're using it, right?

Most regulars here have long since copied all this content, so even if it were to go away there are literally hundreds of copies available, though most of the content in here is related to the 41 and 71 (and some 75) so likely not of too much interest to you. About 80% of the content here is also in the "Swap Disks" Joe Horn has shared with his OLDP.

I thought there was a link to the ftp site on the Museum home page, but I don't see it there now. Maybe not.... Aha, found it on the HP-41 Software Library Page

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
03-25-2018, 08:00 PM
Post: #295
RE: Little explorations with HP calculators (no Prime)
(03-25-2018 07:34 PM)rprosperi Wrote:  Well... you're using it, right?

Most regulars here have long since copied all this content, so even if it were to go away there are literally hundreds of copies available, though most of the content in here is related to the 41 and 71 (and some 75) so likely not of too much interest to you. About 80% of the content here is also in the "Swap Disks" Joe Horn has shared with his OLDP.

I thought there was a link to the ftp site on the Museum home page, but I don't see it there now. Maybe not.... Aha, found it on the HP-41 Software Library Page

I meant "using as contributor" not as a viewer. If there are new contributions there.

I never checked the 41 software library page - aside from brief looks. It is quite a list! what a work. Exactly that type of work I miss a bit for RPL, at least for what I remember. Hpcalc.org is a goldmine, as well as comp.sys.hp48 or this forum, but it is not as categorized as the link above.

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
03-25-2018, 08:45 PM
Post: #296
RE: Little explorations with HP calculators (no Prime)
(03-25-2018 08:00 PM)pier4r Wrote:  I meant "using as contributor" not as a viewer. If there are new contributions there.

I believe the ftp site is write-protected so no one can harm it, but also no one can contribute. This exact same set of stuff (effectively mirrored, before the term was used) was available on several ftp sites in the 90's and early 2000's but I'm glad Dave preserved a copy as all the others I knew of are now gone. This collection may even have originated on an HP Corvallis ftp site, but I'm not certain of that.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
03-25-2018, 09:40 PM (This post was last modified: 03-25-2018 09:41 PM by Dave Frederickson.)
Post: #297
RE: Little explorations with HP calculators (no Prime)
(03-25-2018 08:45 PM)rprosperi Wrote:  
(03-25-2018 08:00 PM)pier4r Wrote:  I meant "using as contributor" not as a viewer. If there are new contributions there.

I believe the ftp site is write-protected so no one can harm it, but also no one can contribute. This exact same set of stuff (effectively mirrored, before the term was used) was available on several ftp sites in the 90's and early 2000's but I'm glad Dave preserved a copy as all the others I knew of are now gone. This collection may even have originated on an HP Corvallis ftp site, but I'm not certain of that.

Here's one of the last mirrors I'm aware of,

ftp://ftp.stak.tk/pub/hpil/
Find all posts by this user
Quote this message in a reply
03-25-2018, 09:43 PM
Post: #298
RE: Little explorations with HP calculators (no Prime)
(03-25-2018 05:01 PM)pier4r Wrote:  while searching around I found.

http://ftp.ftp.hpmuseum.org/

Is it still used?

No ideas about "simultaneous" use of the 2 50g-s ? If I am lucky I get a third for a reasonable price, with warranty.

Can't paste ftp URL's directly into a post. Use Insert hyperlink.

ftp://ftp.hpmuseum.org/
Find all posts by this user
Quote this message in a reply
04-02-2018, 09:29 AM (This post was last modified: 04-02-2018 10:02 AM by pier4r.)
Post: #299
RE: Little explorations with HP calculators (no Prime)
(03-23-2018 02:02 AM)rprosperi Wrote:  Why do you use 2 cables, why not simply disconnect 50g_A, then connect the same cable to 50g_B?

I surrendered to this method. As it seems that the conn4x sees the two calculators, but cannot connect to both of them.

I wanted to spare the USB port too many "plug in", "plug out".

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
04-02-2018, 01:50 PM
Post: #300
RE: Little explorations with HP calculators (no Prime)
(04-02-2018 09:29 AM)pier4r Wrote:  I wanted to spare the USB port too many "plug in", "plug out".

My suggestion is to leave the miniUSB cables plugged-in to both calculators, and only plug/unplug the USB-A (PC side) connector as needed. The USB-A connectors are much more robust than the small and delicate mini-USB.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 5 Guest(s)