Hi @Tim_hms ,
thank you for the suggestions.
I’ve tried it before:
Cyclic Section:
EnableLogging:
//Enable Logging
IF(Trigger@ = 1) THEN
SETSYS TAG, “Load”, “Leistung”
SETSYS TAG, “LogEnabled”,1
SETSYS TAG, “SAVE”
SETSYS TAG, “Load”, “Spannung”
SETSYS TAG, “LogEnabled”,1
SETSYS TAG, “SAVE”
SETSYS TAG, “Load”, “Frequenz”
SETSYS TAG, “LogEnabled”,1
SETSYS TAG, “SAVE”
PRINT “Logging Enabled Successfully”
ENDIF
//Disable Logging
IF(Trigger@ = 0) THEN
SETSYS TAG, “Load”, “Leistung”
SETSYS TAG, “LogEnabled”,0
SETSYS TAG, “SAVE”
SETSYS TAG, “Load”, “Spannung”
SETSYS TAG, “LogEnabled”,0
SETSYS TAG, “SAVE”
SETSYS TAG, “Load”, “Frequenz”
SETSYS TAG, “LogEnabled”,0
SETSYS TAG, “SAVE”
PRINT “Logging Disabled Successfully”
ENDIF
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$ = "Prozess_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_s120$et_s0” //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
Endfn
Init Section:
ONCHANGE “Trigger”, “Goto EnableLogging”
Tset 1,600 //timer set for 600 seconds
Ontimer 1, “@write_data” /
There are no more variable names in the generated “.csv” file.
How can I use the “TagID” before the file creation
replace it with the variable name?
Greetings Michael