Memory Stick Data Logger variable file names
dexf
Posts: 7
All:
I've been using the Memory Stick Data Logger, 27937, quite successfully for some time.
And now, I would like to extend the logging process by saving the results to progressively
different file names (every 24 hours for example). ie: data1.txt, data2.txt and so on.
I use the line(s) like:
SEROUT TX\CTS, Baud, [noparse][[/noparse]$07, $20, "data.txt", CR]
to write the data and control the stick logger.·
What I would like to do is have control of the file name used without having to just repeat
code with differrent file names for the multiple slots in a BS2e. I guess I'm looking for a
more elegant solution. I'd like to build and use a string as a variable for the file name.
So far, I've had no success and wonder if this is even possible with the BS2(e).
If it can help anyone, I'm attaching the entire working BS2 file that I use.
Any help and thoughts would be appreciated.
Dex
I've been using the Memory Stick Data Logger, 27937, quite successfully for some time.
And now, I would like to extend the logging process by saving the results to progressively
different file names (every 24 hours for example). ie: data1.txt, data2.txt and so on.
I use the line(s) like:
SEROUT TX\CTS, Baud, [noparse][[/noparse]$07, $20, "data.txt", CR]
to write the data and control the stick logger.·
What I would like to do is have control of the file name used without having to just repeat
code with differrent file names for the multiple slots in a BS2e. I guess I'm looking for a
more elegant solution. I'd like to build and use a string as a variable for the file name.
So far, I've had no success and wonder if this is even possible with the BS2(e).
If it can help anyone, I'm attaching the entire working BS2 file that I use.
Any help and thoughts would be appreciated.
Dex
Comments
SEROUT TX\CTS, Baud, [noparse][[/noparse]$07, $20, "F",DEC3 FN, ".txt", CR
This uses file names of the form F000.txt through F999.txt.
Perfect.· I just knew there had to be a way.
Many thanks,
Dex
·
Your solution to generate multiple stick files looked good but for some reason, the file name saved to the stick stays the same as "Current0.txt" instead of the expected "Current00.txt". Debug shows it being generated correctly with the same type syntax, but it isn't being passed to the stick through the 27937 module. I've put extra delays in and completely reinitialized the 27937 (see the attached code) for each new file but the lines like:
SEROUT TX\CTS, Baud, [noparse][[/noparse]$07, $20, "Current", DEC2 FN, ".txt", CR]
just aren't working correctly. The same file current0.txt just keeps being overwritten on the memory stick. I don't get both digits.
FN is defined as a nibble. 16 days was plenty and I've run out of RAM space anyway.
The revised code including your suggestion of the above type line(s)·is attached.
I've shortened all timing loops for debugging ease.
I know I must be missing something.
All suggestions appreciated.
Dex
Also, what happens when you set FN equal to something like 10 or 14?
I'm looking at Table 4.1 of the Vinculum VNC1L chip spec and the open, close, delete file op commands don't seem to have that restriction. Other data like the csv that I build, yes.
Mike,
You caught the problem. I've shortenned the file name to currXX.txt and then files are written correctly.
Back to the old DOS days.
And another "closely guarded secret" ( file name length ) exposed. I love it.
Many thanks gentlemen.
Dex