07-03-2017, 08:40 PM
Hi eveybody,
I am working on a project with some variables that must be saved on the $DISK of the SCF01 (like tempetaures and times).
These values must be re-loaded at the next start following each power fail.
My data must be stored in 2 separate files : one for the Temperatures (temp.txt) and one for the Times (time.txt).
Writing the data into both files is OK (tested by reading the content of both files).
Le problem is that I do not find the way to restore these data from the both files to the Sketch.
For one file, it is OK :
in the setup :
Serial2.begin(57600);
Serial2.println("");
Serial2.println("$PING 200");
Serial2.println("$FILE0:OPEN:temp.txt:r");
Serial2.println("$FILE0:RA");
Serial2.println("$FILE0:CLOSE");
and in the loop :
.....
while ((c = Serial2.read()) > '\n') Msg += (char) c;
if (c == '\n')
{
delay(1000);
// From the string "Msg" are extracted the values to be restored, than :
Msg = "";
.....
Since the file is opened in the Setup and read in the loop, how can I proceed to do the transfert from the second file ???
Thank you for your support ...
I am working on a project with some variables that must be saved on the $DISK of the SCF01 (like tempetaures and times).
These values must be re-loaded at the next start following each power fail.
My data must be stored in 2 separate files : one for the Temperatures (temp.txt) and one for the Times (time.txt).
Writing the data into both files is OK (tested by reading the content of both files).
Le problem is that I do not find the way to restore these data from the both files to the Sketch.
For one file, it is OK :
in the setup :
Serial2.begin(57600);
Serial2.println("");
Serial2.println("$PING 200");
Serial2.println("$FILE0:OPEN:temp.txt:r");
Serial2.println("$FILE0:RA");
Serial2.println("$FILE0:CLOSE");
and in the loop :
.....
while ((c = Serial2.read()) > '\n') Msg += (char) c;
if (c == '\n')
{
delay(1000);
// From the string "Msg" are extracted the values to be restored, than :
Msg = "";
.....
Since the file is opened in the Setup and read in the loop, how can I proceed to do the transfert from the second file ???
Thank you for your support ...