The only issue I see with that solution is the tag “Counter” value does not change to zero when reset.
I have tried 2 ways:
- Trying to write the value to zero from the designer.
It does reset thou. You can refresh the tag database to show 0 or wait for the conditions to be true and it starts at 1 again.
If that is not an issue, then take solution should work. Otherwise, the Gateway Tag Change Script will work also.
Something like this:
bool = system.tag.getTagValue(b)
Count = system.tag.getTagValue(c)
if bool == 1:
Count += 1
Then just add the bool tag to the Gateway Tag Change Scripts to call the script.
Hope that helps.