I’ve been working on a project using a flexy and I need to save some tags (40 tags) from diferents PLC’s by event but I had a problem about event repetition when I save them in the Historical Logging.
The script I use is similar to this:
ONCHANGE “event_plc1”,“GOTO EVENT_LOG”
EVENT_LOG:
Setsys Tag,“load”,“TAG_NAME” REM ENABLE Historical logging & Interval Datalogger = 1 seg.
g$=Getsys Tag,“IVgroupA”
If g$=“1” Then
Setsys Tag, “LogEnabled”,“1”
Setsys Tag, “LogDB”,“0”
Setsys Tag, “LogTimer”,“1”
Setsys Tag, “save”
Endif
Cfgsave
Setsys Tag,“load”,“TAG_NAME” REM ENABLE Historical logging & Interval Datalogger = 0 seg.
g$=Getsys Tag,“IVgroupA”
If g$=“1” Then
Setsys Tag, “LogEnabled”,“1”
Setsys Tag, “LogDB”,"-1"
Setsys Tag, “LogTimer”,“0”
Setsys Tag, “save”
Endif
Cfgsave
The script is supposed to save the tag value to the HL and then only enable the “LogEnabled”.
I’ve tried to change Setsys Tag, “LogDB”,“0” to Setsys Tag, “LogDB”,"-1" in the first part but with this change I didn’t see anything in the Historical Logging.
PS. I use this final config.:
Setsys Tag, “LogEnabled”,“1”
Setsys Tag, “LogDB”,"-1"
Setsys Tag, “LogTimer”,“0”
Because I’m using datamailbox and if I don’t enable the HL Logging I can’t get all the historic data from a group. (group A in my case)
Thank you