Question:
How can I create a historic alarms file that is updated daily, always at the same time?
Solution:
To do so, create an expression tag, and fetch its hour attribute in Global Manager. Then, on the tag’s Alarms tab, check Keep tag value always updated to ensure the script is called, because the tag is not linked to any object in the application. After that, create the following script at OnValueChanged event:
DIM FileName
IF hour == 12 AND minute == 00
FileName = “Historic”+Str(day)+Str(month)+Str(year)+”.dat”
CopyFile(Hist1.filename, FileName)
ENDIF
IF hour == 12 AND minute == 00
FileName = “Historic”+Str(day)+Str(month)+Str(year)+”.dat”
CopyFile(Hist1.filename, FileName)
ENDIF