This is an old revision of the document!
USB connectivity
newRPL provides full USB support between calculator and PC: the calculator acts as an HID device, therefore the procedure of first-time setup is minimal, practically non-existent is some cases. The language implements a number of commands to handle file transfer between calculator and PC, as well as firmware update, as easy as possible.
Connection
- Start newRPL Desktop and plug in the calculator to the PC;
- from the Hardware menu choose USB Connections…
- under the menu will appear a status bar with a button labeled [ Select a USB device ];
- after clicking it, a list of devices connected to the PC will be shown: selecting the calculator and clicking Ok will complete the connection;
- if everything went ok, the status bar will change accordingly;
In case of disconnection the status bar will show [ Click to reconnect ] allowing a quick reconnection of the calculator.
Data Transfer
Once the communication channel is set up, to transfer an object to newRPL Desktop use the command USBSEND
: if the transfer is successful, the object will appear on newRPL Desktop screen.
Since USBSEND
returns 1
in case of success and 0
otherwise, this snippet of code is the preferred way to ensure that the object on level 1 is transferred.
« DO DUP UNTIL USBSEND END DROP »
The receiving calculator will immediately XEQ
'te the object after the trasfer has completed provided no other program is currently in execution. In that case XEQ
'tion will be post-poned after the first program has terminated.
The command USBRECV
is used to manually receive an object (avoiding to run it if it's a program): it accepts a time-out in seconds, after which the transfer is aborted. Alternatively, setting flag -47 will achieve the same effect. In any case, if there's data waiting to be received a RX indicator will be displayed in the status area; since transfer are not queued if there's an object waiting to be received, any other USBSEND
command issued by the source calculator will fail.