Historical Logging, Straight to SD Card


I’m looking at logging historical data on our flexy units over a long period of time, at a reasonably high rate (every 10 seconds). I have left it on for several days but the buffer has filled up and data lost.

I have found old posts on here that mention using a SIM card, but then manually having to program the flexy to write onto the card.

I also found that the user directory is automatically written onto the SD card if present in some of the documentation.

Which one of these is currently true? Can I just put a SD card with the correct format in and then the system will start logging onto it and use the increased space to increase the buffer space for samples?


Hello I will get this documentation for you and follow up.

Hi Kevin,

Did you manage to find any documentation on this?



So i did some scouring but I couldn’t find an official document that details the outline of logging to the SD card. However, i was able to find some example code.

Tset 1,600 //timer set for 600 seconds
Ontimer 1, “@write_data” // every 600 seconds it will call the function write_data

Function write_data()

T$ = TIME$ // grabs the current time

$Date$ = T$ (4 To 5) + “" + T$ (1 TO 2) + "” + T$ (7 TO 10) + “" + T$(12 To 13) + "” + T$(15 To 16) + “_” + T$(18 To 19) // puts the time into this format MMDDYYYY HHMMSS

$CustomFileName$ = “Historical_Log_” + $Date$ //names the file “Historical_Log_” followed by the current time
$FileName$ = “/usr/” + $CustomFileName$ + “.csv” //writes it into the usr directory and writes it as a csv file
$EBD$ = “$dtHL$ftT$st_m10$et_m0$ut” //dtHL is historical logs for all tags, ftT is saying its a text filetype st_m10 means it’s grabbing all the data from 10 minutes ago
// et_m0 means that it’s going from 10 minutes ago to the current time.
// to modify what is being grabbed please visit: https://ewonsupport.biz/ebd/

Print $FileName$ // just says the current name of the file
WriteEBD $EBD$,$FileName$ // writes the csv to the sd card
print “Historical data written” // just a check to see that it made it to this step and lets you know that it performed the writeebd


You can modify the code above to write the write to the Card.

As for the buffer space, The buffer space is defined with the memory. You will need to create frequent logs files, in order to ensure that none of the data is overwritten if you increase the speed of logging.