Post Reply 
newRPL - build 1001 released! [update:build 1016]
12-15-2017, 10:15 PM (This post was last modified: 01-03-2018 06:02 PM by Claudio L..)
Post: #1
newRPL - build 1001 released! [update:build 1016]
Quick links section (this will remain on top, see below for other info):

Latest development ROMS can be found following these links for the 50g, the 39gs /39g+ and the 40gs
Currently they are at build 1016, while the official release remains at 1001.

Official release files for the different targets can be downloaded directly from Sourceforge.
** Important **: Starting with the build 1001 release, the PC simulator is also the connectivity kit (not just a demo), so go ahead and install it too!. Mac and Linux users have to build from sources but it's perfectly compatible.

Also, please head over to the newRPL Official Wiki for installation instructions and general useful information.

Release notes (build 1016):

* Indexing of lists and matrices in symbolics, doing A(1,1) within a symbolic expression will GET elements if A is a list or a matrix.
* Indexing of matrices and lists in STO now works, so
1234 'A(1)' STO

will replace the first element in a vector or list.

* New and improved FUNCEVAL operator takes care of the internals of 'X(...)' in symbolics.
* A bug was found in the error handling of certain list operations. This is very likely responsible for the disabled undo feature reported. It's fixed.
* Stack not cleaned up during SORT errors, fixed.
* Improved error display shows name of missing variables.
* A new BINDATA object type was added to replace HEX strings as generic containers.

New commands added:
MKBINDATA: Creates a binary storage object (just provide a size in bytes)
BINGETB/BINPUTB: PUT/GET bytes inside of a BINDATA object.
BINGETW/BINPUTW: PUT/GET 32-bit words inside of a BINDATA object
BINGETOBJ/BINPUTOBJ: Store/Extract a binary copy of an RPL object inside a BINDATA.
BINMOVB/BINMOVW: Copy bytes or 32-bit words from one BINDATA to another BINDATA.



Release notes (build 1001):

* In this release, a lot of matrix related commands were implemented. Check with the detailed project status to see which commands are ready to use.
* USB communications are fully supported on all 4 targets.

USB comms are implemented as an HID device, therefore it doesn't need device drivers on any operating system. It's mostly self-explanatory, but in the next few days a more detailed description will go in the wiki.

The concept is very simple:
* Plug the cables, then on the host use the menu to show the connection panel, click the massively large button to select a device. If everything is connected well, you should see your calculator on the list. Select one of the calcs from the list (I only had one to test, but should be fine with many) and hit OK. The connected indicator will show on the simulated calc. At this point, the big button will indicate which calculator it's connected to. If the calc disconnects for any reason, the button will show "Click to reconnect". You are all set.
* You can send an object that's on the stack with USBSEND, returns 1 if successful, 0 if not.
* The other calc will receive the object and automatically do XEQ on it. This means if you send a program it will run automatically, other objects are simply left on the stack. Programs run automatically when the calculator is idle, so if it's running a program it will wait until it finishes to run the received object.
* You can manually receive an object (without executing it) with USBRECV. Just put a time in seconds on the stack (it waits up to that time for an object to come through the wire, can be canceled pressing ON). It returns on level 1 the number 1 if successful, 0 if not. If successful, level 2 has the object received.
* If you are not happy with automatic execution of remote commands, it can be disabled by setting flag -47. An "RX" indicator will show on the status area when there's an object waiting to be received. Use USBRECV to get the object. Until the object is processed, the device can't receive any new objects (any attempt at USBSEND from the other end will fail).

And that's all there is to it. Very simple, yet very powerful, and while testing this I had the most fun in a long time!
A few examples of what you can do:
Simple ping-pong program:
Code:

«
  @@ WRITE A PROGRAM THAT SENDS PONG BACK TO US
  «
    "PING"
    "PONG"
   DO
    DUP 
  UNTIL USBSEND END
  DROP 
  »
  @@ AND SEND THE PROGRAM TO THE OTHER SIDE
  DO
    DUP 
  UNTIL USBSEND END
  DROP 
»


Remote RCL:
Code:

«
  USBSEND DROP @@ SEND THE VARIABLE NAME TO THE OTHER SIDE

 @@ NOW CREATE A PROGRAM TO RCL AND SEND BACK THE RESULT
  «
    RCL 
    DO
      DUP 
    UNTIL USBSEND END
    DROP 
  »
  @@ AND SEND THE PROGRAM TO BE AUTO-EXECUTED OVER THERE
  DO
    DUP 
  UNTIL USBSEND END
  DROP

  @@ WAIT A COUPLE OF SECONDS FOR THE CONTENTS TO ARRIVE
  2 USBRECV DROP 
»

Similarly, a remote STO command:
Code:

«
  2 →LIST USBSEND DROP  @@ MAKE A LIST WITH VALUE AND VARIABLE NAME AND SEND IT

  @@ WRITE A PROGRAM TO EXPLODE THE LIST AND DO 'STO' IN THE OTHER CALC
  «
    OBJ→ DROP STO 
  »

  @@ AND SEND IT!
  DO
    DUP 
  UNTIL USBSEND END
  DROP 
»

And there's a couple more commands that are extremely useful, especially for the 39/40 series where the SD card is not available:
USBARCHIVE/USBRESTORE will send a backup file over the USB wire. The format is 100% identical and compatible with SDARCHIVE/SDRESTORE.

USBRESTORE requires a timeout in seconds, just like USBRECV. Be aware that it works just like SDRESTORE, and without any warning will replace the entire calculator contents.

For example, to clone your physical calculator, just run 30 USBRESTORE on the simulator, then USBARCHIVE on your calc. The opposite works too, you can clone the simulator into your calc.
The simulator has 2 menu options to perform unattended ARCHIVE/RESTORE operations on the connected device without affecting the simulated one, saving/reading directly from disk. It's entirely hands-free operation (there's no need to type USBARCHIVE on the calculator), it pretty much works like the File->Open/Save menu options in the simulator, but for the physical calc at the other end of the wire.
A file with a backup created this way can be opened in the simulator from the menu (with File->Open), and also restored to the physical calculator via SD card and SDRESTORE, the files are completely interchangeable, even between different calculator models.
Of course, different models have different amounts of RAM, if you fill 1 MB on the simulator, the backup won't fit on the 50g. If you fill more than 256 kbytes on a 50g, you won't be able to use those backups on a 39 or 40.

Enjoy!

PS: Perhaps this should be called "newRPL Holiday Edition" instead of the boring "Build 1001"...
Find all posts by this user
Quote this message in a reply
12-15-2017, 10:21 PM
Post: #2
RE: newRPL - build 1001 released!
A side note:

On the models that support USB power, the battery indicator will turn gray when the USB cable is plugged, to indicate it's drawing power from the USB port.

USB comms require the CPU to run faster than the usual idle speed, so power consumption goes up when you are plugged in. This is not a problem on the newer models that support USB power, but might drain your batteries faster on the older models that don't take power from USB.
Also keep in mind while a USB connection is active the auto-off feature is disabled to preserve the connection and the ability to respond to remote commands. A non-issue when using USB power but keep it in mind for the older models.
Find all posts by this user
Quote this message in a reply
12-15-2017, 10:42 PM (This post was last modified: 12-15-2017 11:10 PM by The Shadow.)
Post: #3
RE: newRPL - build 1001 released!
Hmm. Finding my calculator's USB cable might be a serious challenge. What other cables will work?

Great work as always! What's next on your plate?

EDIT: Whoa, I just noticed that RAND got added! What algorithm did you end up using?

Also, it isn't quite true to list STREAM as compatible: The stack protection makes some old programs no longer work.
Find all posts by this user
Quote this message in a reply
12-16-2017, 01:17 AM (This post was last modified: 12-18-2017 05:03 PM by matthiaspaul.)
Post: #4
RE: newRPL - build 1001 released!
(12-15-2017 10:42 PM)The Shadow Wrote:  Finding my calculator's USB cable might be a serious challenge. What other cables will work?
The calculators have a normal USB Mini-B receptable. Assuming your PC has USB Standard-A receptables, any standard-conformant USB cable with a Standard-A plug on one side and a Mini-B plug on the other will do.

Greetings,

Matthias


--
"Programs are poems for computers."
Find all posts by this user
Quote this message in a reply
12-16-2017, 02:22 AM
Post: #5
RE: newRPL - build 1001 released!
(12-16-2017 01:17 AM)matthiaspaul Wrote:  
(12-15-2017 10:42 PM)The Shadow Wrote:  Finding my calculator's USB cable might be a serious challenge. What other cables will work?
The calculators have a normal USB Micro-B receptable. Assuming your PC has USB Standard-A receptables, any standard-conformant USB cable with a Standard-A plug on one side and a Micro-B plug on the other will do.

Greetings,

Matthias

Careful, it's not micro, it's mini type B,something like this one.
I chose it for the clear picture of the connector, not vouching for quality or price or anything really.
Find all posts by this user
Quote this message in a reply
12-16-2017, 02:32 AM (This post was last modified: 12-16-2017 02:32 AM by Claudio L..)
Post: #6
RE: newRPL - build 1001 released!
(12-15-2017 10:42 PM)The Shadow Wrote:  Hmm. Finding my calculator's USB cable might be a serious challenge. What other cables will work?

This was already answered, but I'll insist to pay attention to the difference between mini and micro. Or best, you can buy some kits that come with all kinds of adapters, so you can use the cable for other things when not for the calculator.

(12-15-2017 10:42 PM)The Shadow Wrote:  Great work as always! What's next on your plate?
Chicken and french fries. I'll take a couple of weeks of holiday break with only bug fixing, then I'll get back at things I left incomplete: the matrix module is still missing a few commands, the plotting engine needs to be finished, and the Forms engine needs to take form (clever choice of words there ;-)

(12-15-2017 10:42 PM)The Shadow Wrote:  EDIT: Whoa, I just noticed that RAND got added! What algorithm did you end up using?
The one you suggested, xoroshiro128+. I created a separate module rng.c so more RNGs can be added if ever needed.

(12-15-2017 10:42 PM)The Shadow Wrote:  Also, it isn't quite true to list STREAM as compatible: The stack protection makes some old programs no longer work.
True, I'll have to mark those in yellow. Good catch.
Find all posts by this user
Quote this message in a reply
12-16-2017, 08:03 AM
Post: #7
RE: newRPL - build 1001 released!
Awesome!

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
12-16-2017, 08:20 PM (This post was last modified: 01-02-2018 12:55 PM by compsystems.)
Post: #8
RE: newRPL - build 1001 released!
This version is considered the first ßeta version?

Claudio can please do simple example of connection hp50<->arduino/blackberry/..., It could compete with the ti-nspire

[Image: CcEOqOGWAAEWCGk.jpg]

The community would develop great projects, where making codes within the microcontroller is very difficult
https://www.youtube.com/watch?v=lf_7XNmpfxA

[Image: Cu1yLi3WYAA6qLv.jpg]

http://www.hpcalc.org 20 years online
Visit this user's website Find all posts by this user
Quote this message in a reply
12-16-2017, 08:29 PM (This post was last modified: 12-16-2017 08:30 PM by Gilles59.)
Post: #9
RE: newRPL - build 1001 released!
Quote:Currently they are at build 1001

Champagne! ;D
Find all posts by this user
Quote this message in a reply
12-16-2017, 08:38 PM
Post: #10
RE: newRPL - build 1001 released!
(12-16-2017 08:20 PM)compsystems Wrote:  This version is considered the first beta version?

Claudio can please make simple example of connection arduino-hp50

I didn't put any labels, just removed the alpha. You can call it beta if you know the greek alphabet.
The 50g is a device, unless you can make the arduino become a host you won't be able to communicate.
Find all posts by this user
Quote this message in a reply
12-16-2017, 08:44 PM
Post: #11
RE: newRPL - build 1001 released!
(12-16-2017 08:29 PM)Gilles59 Wrote:  
Quote:Currently they are at build 1001

Champagne! ;D

I swear the mumber was pure coincidence. I was going to release 996, then found a couple more bugs and ended up at 1001.
Full disclosure: I called it build number but it's actually the number of commits in the repository, I built it many, many more than 1000 times.
Find all posts by this user
Quote this message in a reply
12-16-2017, 08:49 PM (This post was last modified: 12-16-2017 08:53 PM by Gilles59.)
Post: #12
RE: newRPL - build 1001 released!
Buid 1001 on my HP50g ;D

Claudio, where is the download for the simulator ?

EDIT : OK -> https://sourceforge.net/projects/newrpl/files/
Find all posts by this user
Quote this message in a reply
12-16-2017, 09:05 PM (This post was last modified: 12-16-2017 09:07 PM by rprosperi.)
Post: #13
RE: newRPL - build 1001 released!
(12-15-2017 10:15 PM)Claudio L. Wrote:  Official release files for the different targets can be downloaded directly from Sourceforge.

Note that on the SF site, the "TARGET 39gs-ROM" folder contains the file newRPL-1001-firmware-40gs.bin, whereas all the other files in this folder were ...39... versions.

Perhaps they are the same?

Oh, and thanks Claudio for the major new version of newRPL including sync with the PC side, another in a season of great calculator Christmas Presents.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
12-17-2017, 05:15 PM
Post: #14
RE: newRPL - build 1001 released!
(12-16-2017 02:32 AM)Claudio L. Wrote:  
(12-15-2017 10:42 PM)The Shadow Wrote:  EDIT: Whoa, I just noticed that RAND got added! What algorithm did you end up using?
The one you suggested, xoroshiro128+. I created a separate module rng.c so more RNGs can be added if ever needed.


Did it end up acceptably fast for 2000 digits? Then again, at 2000 digits I imagine everything is slow.

Would new RNGs get their own commands?
Find all posts by this user
Quote this message in a reply
12-17-2017, 08:18 PM
Post: #15
RE: newRPL - build 1001 released!
(12-16-2017 09:05 PM)rprosperi Wrote:  
(12-15-2017 10:15 PM)Claudio L. Wrote:  Official release files for the different targets can be downloaded directly from Sourceforge.

Note that on the SF site, the "TARGET 39gs-ROM" folder contains the file newRPL-1001-firmware-40gs.bin, whereas all the other files in this folder were ...39... versions.

Perhaps they are the same?

Oh, and thanks Claudio for the major new version of newRPL including sync with the PC side, another in a season of great calculator Christmas Presents.

The files are not the same. Just in case I deleted and re-uploaded the correct file. Thanks for the heads up.
Find all posts by this user
Quote this message in a reply
12-17-2017, 09:22 PM
Post: #16
RE: newRPL - build 1001 released!
Hi Claudio,

Just installed the latest firmware.

Just to let you know, after re-boot I ended up with a bunch of new variables. One was called "OOOOAAA", one other "Local", the last one I don't remember. I just purged them and there is no side effects.

I tried the USB communication with the PC host. It works as you described. Lots of possible applications I can see. Need to have the simulator installed on my mac first.

Will try the matrix commands next.

François
Find all posts by this user
Quote this message in a reply
12-18-2017, 04:20 AM
Post: #17
RE: newRPL - build 1001 released!
(12-17-2017 09:22 PM)Francois Lanciault Wrote:  Hi Claudio,

Just installed the latest firmware.

Just to let you know, after re-boot I ended up with a bunch of new variables. One was called "OOOOAAA", one other "Local", the last one I don't remember. I just purged them and there is no side effects.

I tried the USB communication with the PC host. It works as you described. Lots of possible applications I can see. Need to have the simulator installed on my mac first.

Will try the matrix commands next.

François

Glad to hear USB works as expected, I only tested on my hardware so I'm not 100% sure the timings work for all hardware combinations.
Regarding the weird variable names, that happens when a variable name becomes corrupted, the recovery runs on power up and recovers the objects but assigns a random name. Most likely those were settings with names in ROM. Perhaps the names moved in the ROM (shouldn't but maybe I messed something up). In any case, settings are recreated and nothing bad happens. When you see those weird names, always take a look at what they are. If is not something important you lost, they are safe to delete.
Find all posts by this user
Quote this message in a reply
12-18-2017, 04:24 AM
Post: #18
RE: newRPL - build 1001 released!
(12-17-2017 05:15 PM)The Shadow Wrote:  Did it end up acceptably fast for 2000 digits? Then again, at 2000 digits I imagine everything is slow.

Would new RNGs get their own commands?

I didn't run any benchmarks, but feels instantaneous so it's good enough.

Regarding command names, we can either make the rng selectable through flags or Settings, or use separate commands, I don't have a preference either way.
Find all posts by this user
Quote this message in a reply
12-18-2017, 05:05 PM
Post: #19
RE: newRPL - build 1001 released!
(12-16-2017 02:22 AM)Claudio L. Wrote:  Careful, it's not micro, it's mini type B
Ush. Thanks for the correction. I should have looked at my calc rather than relying on Wikipedia... On the good side, this helped to fix a few bugs there...

Greetings,

Matthias


--
"Programs are poems for computers."
Find all posts by this user
Quote this message in a reply
12-18-2017, 08:53 PM (This post was last modified: 12-18-2017 08:55 PM by Claudio L..)
Post: #20
RE: newRPL - build 1001 released!
(12-17-2017 09:22 PM)Francois Lanciault Wrote:  Need to have the simulator installed on my mac first.
François

Please report back about compiling for Mac, I'd like to know if there are any problems. The simulator uses a third party library called HIDAPI, which is embedded in the simulator, so there's no extra dependencies, but I never built for Mac. From what I read there's no specific additional dependencies for Mac so I think it should just compile and work fine, but let me know.
I also don't know about permissions on Mac. Other Unixes/Linuxes need to specifically authorize the current user to read/write the USB devices directly, perhaps you need to investigate that for Mac as well.
For example, on Linux it needs the hidraw interface enabled in the kernel. This is included by default on all major distros on PC, but if you are perhaps on a Raspberry Pi or other smaller host it may not be enabled. On Linux it also needs now libudev, which again is present on all major distros, but in order to compile your simulator you need to install libudev-devel packages first. Please report back, if you need to take any extra steps to build on a Mac let me know and we can put it all on the wiki.
Find all posts by this user
Quote this message in a reply
Post Reply 




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