Looking for a way to trigger a report every 30 min after a bool goes true.
Right now I just have an expression tag with this script :
(dateFormat(now(),“mm”)=“30”) || (dateFormat(now(),“mm”)=“00”)
but this will run the report every half hour what I need is if the Bool goes true @ 3:23pm I need the memory tag to execute at 3:53pm then again @ 4:23pm instead of waiting till 4:00pm and 4:30pm
I then have a gateway tag change script that will do the system.report.executeAndDistribute
Enable: Boolean to enable/disable report generation.
MinutesA: Integer that stores the minutes of when Enable changed dateExtract({[.]Enable.LastChange},"minute")
MinutesB: 30 minute offset from MinutesA
({[.]MinutesA}+30) % 60
Report Trigger: Boolean used to generate the report
I knew it had to be something like this but just didn’t know how to go about it. The trick that I didn’t know was the Enable.LastChange - that was the missing piece I did not know existed.
Only issue I am having now is I am using a gateway tag change script to execute my report - but it creates two reports for the OnTrue and OnFalse - Is there a way to only execute code in the tag change script when it goes OnTrue?
I am used to WW programming that has an option for OnTrue and OnFalse inside the script editor.