Programmatic control of writing to file system

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

Re: Programmatic control of writing to file system

Post by isene »

Mark Hardman wrote:
Sat Mar 21, 2020 12:24 am
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.
Good point - that slipped my mind.

Is there a way to save an XM ascii file to disk? (this is at least a temporary fix to have my observation files for my telescope transfered to my PC).
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 »

isene wrote:
Sat Mar 21, 2020 10:53 pm
Is there a way to save an XM ascii file to disk? (this is at least a temporary fix to have my observation files for my telescope transfered to my PC).
No, not directly, the only objects one can save to the FAT drive are:

a. FOCAL programs (in .raw format)
b. DM41X State file

The State File contains all user and extended memory, so with a fair amount of work you could extract the contents of a single XM file by parsing through the image and searching for the XM ascii file (the XM and ascii file format is documented in several places, including p. 8 of Jeremy Smith's Synthetic Quick Ref. Guide).

Not great news, but since the memory structure is relatively simple (no compression, linear, predictable address range) it lends itself to being readily extracted by a program.
--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 »

I will try to decode the file.
isene
Posts: 44
Joined: Sat Jul 22, 2017 2:02 am

Re: Programmatic control of writing to file system

Post by isene »

Here goes.

This Ruby program will extract an ASCII eXtended Memory fiile from a DM41X state file:

https://github.com/isene/dm41xm
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 »

Great news, that was faster than I imagined. :)

I'm not a user of Ruby and have no need to extract XM files, but I presume you have a very specific application in mind, related to your telescope IIRC, and it would be great if you could share the overall scenario and instructions here (or a link here to an article on your site) once it's all working.
--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 »

rprosperi wrote:
Mon Mar 30, 2020 10:54 pm
Great news, that was faster than I imagined. :)

I'm not a user of Ruby and have no need to extract XM files, but I presume you have a very specific application in mind, related to your telescope IIRC, and it would be great if you could share the overall scenario and instructions here (or a link here to an article on your site) once it's all working.
You are most surely a Ruby user :-) Given that you surf the web, it is virtually inevitable. But, to run my program, you need to ave Ruby installed on your PC. I could just as well have written the program in Python, Perl, PHP, Julia, NIM or even FORTRAN. But it's faster for me to do it in Ruby.

My need to transfer XM ASCII files to my PC is two-fold. I have a program in the ISENE.ROM that is called HOURS. It is a simple way for me to register my billable hours for the range of customers I have. At the end of every month I tally up the hours for each and send the invoices. To go into the calculator and then go through the file and write the same on the PC is stupid work. So, I need to get the data from the calc over to the PC to get the list of dates and hours as a specification in my invoice. So, if I am to move from my HP-41CL to my DM41X, I need this transfer program.

Then it's my astronomy hobby (https://isene.org/astro/). I make observation lists on my calc (lists of cool objects to look at through my telescopes (galaxies, nebulae, star clusters, double stars, etc.) with the program OBSERVE (https://github.com/isene/hp-41_observe). I can use my HP-41CL as a hand-held controller for my scope by hooking it up to my PC and have my PC control the telescope mount via Bluetooth to point to the various objects in the sky from my observation list. That I can then just press R/S on the calc to have the telescope point to the next object in my list is obviously über-cool. Which is why I cannot actually move from my HP-41CL to my DM41X just yet. But I wish I could because the DM41X is more sturdy. But at least I can now transfer the lists I make on my DM41X to my PC without having to key in long lists of celestial objects manually twice.
Post Reply