Programmatic control of writing to file system

Discussion about the new DM41X calculator
isene
Posts: 44
Joined: Sat Jul 22, 2017 2:02 am

Programmatic control of writing to file system

Post by isene »

Use case: Control my telescope (mount) with an DM41X.

I can do this with an HP-41 hooked up top my PC via HP-IL/PIL-box, send coordinates by printing then add strings via HP-IL to my PC where a Ruby program is listening and forwarding the coordinates to an INDI server running on my PC which in turn sends commands to my telescope mount via a bluetooth setup.

Since the DM41X does not have HP-IL, I could instead do this by having a Ruby program running in my PC listening to any changes in a file on the DM41X. But that would require programmatic control of writing to the file system on the calculator - as I want real time interfacing where I push R/S to have the telescope point to the next object in an XM file.

Is this possible somehow?
rprosperi
Posts: 1048
Joined: Mon Apr 24, 2017 7:48 pm
Location: New York

Re: Programmatic control of writing to file system

Post by rprosperi »

Not possible at this time, and no current plans to do anything like that.

And while some sort of HP-IL capability is not in the currently announced plan, it has not been totally ruled out for some future version, as the extensive virtual IL support by the community may make some of this feasible.

At the moment however, what you could do is use the IR Printing capability in the current 41X and cobble together some kind of IR receiver to serial port and 'print' strings of characters, decode them with Ruby, etc. on the PC and relay that to the telescope.
--bob p

DM42: β00071 & 00282, DM41X: β00071 & 00656, DM10L: 071/100
isene
Posts: 44
Joined: Sat Jul 22, 2017 2:02 am

Re: Programmatic control of writing to file system

Post by isene »

Yes, that could be done.

Would it be possible to add a "print to file" command to programatically print either pure alphanumerics or even raw programs to file? That seems by far the easiest approach and would in the simplest of ways provide an interface with the outside world (a poor man's IL)
MeinKuipers
Posts: 30
Joined: Mon Jan 13, 2020 4:49 pm
Location: Netherlands

Re: Programmatic control of writing to file system

Post by MeinKuipers »

Good point Geir, a Print to File would be something nice to start with
Regards from NL,
Meindert Kuipers DM41X #48
isene
Posts: 44
Joined: Sat Jul 22, 2017 2:02 am

Re: Programmatic control of writing to file system

Post by isene »

That would solve all my HP-IL use cases and could in fact replace a one-way HP-IL. A read-from-file could replace HP-IL entirely.
isene
Posts: 44
Joined: Sat Jul 22, 2017 2:02 am

Re: Programmatic control of writing to file system

Post by isene »

If anyone in the project is reading this, here is my feature request:

Two HP-41 commands in order of priority:

PRASF = PRint AScii to file (takes name of XM ASCII file in alpha and prints that to a file with that name on the file system)

PRPF = PRint Program to file (name of program in alpha, prints program to a file in raw format)
rprosperi
Posts: 1048
Joined: Mon Apr 24, 2017 7:48 pm
Location: New York

Re: Programmatic control of writing to file system

Post by rprosperi »

At the moment, there is no plan to introduce functions which cross the 41 OS / Emulation plane, as these would require.

PRPF is not necessary as you can export a file to .raw now via the SETUP menu. If you meant as a programmable command, that would fall into the guideline noted above.

In the distant future (end of this year/early next year ??) some of these broader extensions may be reassessed.
--bob p

DM42: β00071 & 00282, DM41X: β00071 & 00656, DM10L: 071/100
isene
Posts: 44
Joined: Sat Jul 22, 2017 2:02 am

Re: Programmatic control of writing to file system

Post by isene »

But the FAST function crosses that boundary, no?

And yes, my point was to have a way - any way - to send bytes to a PC via a program. That would be a huge improvement to the DM41X given the lack of HP-IL.
User avatar
Mark Hardman
Posts: 116
Joined: Wed May 03, 2017 3:26 am
Location: Houston, TX

Re: Programmatic control of writing to file system

Post by Mark Hardman »

Not sure if anyone has made this point. Even if you had the ability to write to the DM41X's file system, currently you wouldn't be able to read that file from your PC while, say, a program is running. The USB disk is only accessible when you are in the dedicated USB mode. I don't know what limits the DM42/DM41X hardware to this dedicated requirement, but my intuition tells me it's a substantial technical hurdle.

Still, we can all dream of virtual HP-IL support at some future date. I'm willing to wait.
DM42: β00043, β00065, 00357 / DM41X: β00054, 00445
DM10L: 017/100, DM11L: 00121, DM12L: 02005, DM15L: 00523, DM16L: 00008, DM41L: 00111
rprosperi
Posts: 1048
Joined: Mon Apr 24, 2017 7:48 pm
Location: New York

Re: Programmatic control of writing to file system

Post by rprosperi »

Mark is exactly right, a limitation of the h/w and system design. sorry, I thought that was understood, however it's good that it's come up to make the situation clear.

As I suggested above, the only way to send bytes to a PC via program is to use the IR transmitter. If that's important, I'd start on that right away, as it's likely to be finicky, though the IR protocol used by the 82240A/B is fairly well documented.

This document is a good starting place, and PPC Technical Note #64 adds more details too.

https://www.hpcalc.org/details/4741

Both docs are from an HP-48 perspective, but it's the same protocol.
--bob p

DM42: β00071 & 00282, DM41X: β00071 & 00656, DM10L: 071/100
Post Reply