Logging data on SD card


#1

I’m trying to increase my knowledge well on how to use SD on EWon Device Flexy 205. The Ewon Firmware is updated to 13.02s

I want to log historical data on an SD card on monthly basis and then use FTP Server to access the historical data. The format for the log file should be in CSV.

Please, could you guide me on how to write the script IDE

I saw the below script but am not sure if this would work for me,

IF di@ = 1 THEN
SETSYS INF, “LOAD”
SDCardSize$ = GETSYS INF, “SDExtFree”
SDCardSize_Int% = Val SDCardSize$
IF SDCardSize_Int% > 5000 THEN // 5 MB remains
EBD_STRING$ = “$dtHL$ftT$st_h4$et_s0”
FILENAME$ = “/usr/sdext/DataReport” + TIME$ + “.txt”
WRITEEBD EBD_STRING$, FILENAME$
ActionID% = GETSYS Prg, “ACTIONID”
ELSE
LOGEVENT “EUM Card full or not present”, -1
ENDIF
ENDIF


#2

Hello this should work, but if you want to send as a csv file, you’ll need to change it from .txt to .csv


#4

Thanks, question do you know if the next month data will overwrite the stored data on the SD card. or would it create a spread file ?


#5

Hello,

I believe if the SD card becomes full it will start running into issues but will not overwrite the file. We’d recommend either removing or deleting the file after the SD card runs out of room


#6

Can you send a script that I could test please.

The work instruction I saw online is not working for me. please send a script IDE which I could test.


#7

What errors are you getting from the script above?