data logger creating multi files
ftech
Posts: 8
Hi all
I have a need to do one of two things with the data logger and its driving me nuts. speed is not a huge issue but want seconds not minute to execute.. if it is at all possible.
·
I want to either open three files on the memory stick and write to them at different times over a day period... i.e.
File one ... pin 1·goes high it writes data in EPROM to file one
File two...· pin 2 goes high it writes different date string
File three.... this can either be continuous write data if neither above action or set to a pin reference.
·
OR
·
With above mention pin actions open a new file each time without erasing previous...
·
I guess what I am asking for simply is can I have a variable/counter/name change in a file command string
·
·SEROUT TX\CTS, Baud, [noparse][[/noparse]$09, $20, "datafile.txt", CR]···
·
i.e.
·
file one.............................. datafile1
file two...............................datafile2
file three..............................datafile3
·
or
datafile ,1,2,3,4,5,6,7,8,9,10, 11...etc
Just to add extra degree of difficulty if possible and really prefered but can maybe get around it if have to....Is to·have it not delete any file on restart or if data stick left in at end of day... ie never overwrite a file... using date and time maybe as file name to prevent over writing is what i thought of... hence asking how I can create a gosub or get in the file name string..
hope not asking toooo much... place to start would be great not asking anyone to write program for me
·
thanks for any help or clues cheers
I have a need to do one of two things with the data logger and its driving me nuts. speed is not a huge issue but want seconds not minute to execute.. if it is at all possible.
·
I want to either open three files on the memory stick and write to them at different times over a day period... i.e.
File one ... pin 1·goes high it writes data in EPROM to file one
File two...· pin 2 goes high it writes different date string
File three.... this can either be continuous write data if neither above action or set to a pin reference.
·
OR
·
With above mention pin actions open a new file each time without erasing previous...
·
I guess what I am asking for simply is can I have a variable/counter/name change in a file command string
·
·SEROUT TX\CTS, Baud, [noparse][[/noparse]$09, $20, "datafile.txt", CR]···
·
i.e.
·
file one.............................. datafile1
file two...............................datafile2
file three..............................datafile3
·
or
datafile ,1,2,3,4,5,6,7,8,9,10, 11...etc
Just to add extra degree of difficulty if possible and really prefered but can maybe get around it if have to....Is to·have it not delete any file on restart or if data stick left in at end of day... ie never overwrite a file... using date and time maybe as file name to prevent over writing is what i thought of... hence asking how I can create a gosub or get in the file name string..
hope not asking toooo much... place to start would be great not asking anyone to write program for me
·
thanks for any help or clues cheers
Comments
The file name is just an output string like any other. You can construct the file name portion from pieces just like you'd display something like:
SEROUT TX\CTS, Baud, [noparse][[/noparse]$09, $20, "datafile", DEC number, ".txt", CR]
"number" would be a variable or expression, whatever you need.
The datalogger doesn't delete files unless you command it to do so, but it will overwrite an existing file. You could use subdirectories and make the subdirectory name out of the date (like 2009-09-22). Alternatively, you could have a file called "datafile.txt" that only contains the number of the last file written and always read that file at the beginning of a day (when the day is entered).
Jeff T.
think I can get it sorted now just have to try a few methods.... like the folder idea didnt even think of that one and I look into the "wrf" to
thanks so much cheers
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
50 72 6F 6A 65 63 74 20 53 69 74 65
·
I had that problem but didnt realize it... accidently skipped around it.. that explaines now why one file work and the other didnt...one was to large!
Cheers thanks for that Chris and others!