Well, I think I can get you half way there (actually, all the way there, unless you’re trying to do some fancy triggering…)
Take your input tag (which has to be an opc tag in this case…) and put it in your group, make it read-only if so desired, and turn on “hour meter”. This will cause its value to actually be a counter of how long it’s 1. By NOT using “retentive”, it will reset to 0 when the input goes back to 0.
Now create an action item. You just need a simple expression:
That should be it. I’d run the group at 1 second or so. The only other thing to know about hourmeters is that while the item’s internal value is the counter, the raw PLC value is what is shown in “value” column in factorysql, so don’t freak out if it doesn’t seem to be working there.
Hope that helps,