Question:
How can I generate a daily historic file?
Solution:
To do so, follow these procedures:
- Create an expression tag and retrieve Day attribute from the Global Manager.
- On this tag’s Alarms tab, check the option Keep tag value always updated.
- Then, create the following script at the OnValueChanged event:
DIM FileName
FileName = StrZero(day-1,2)+StrZero(month,2)+Str(year)
CopyFile(Hist1.filename, Str(FileName)+”.dat”)
Hist1.ClearHistoricalData()
FileName = StrZero(day-1,2)+StrZero(month,2)+Str(year)
CopyFile(Hist1.filename, Str(FileName)+”.dat”)
Hist1.ClearHistoricalData()