Timer function that works gloabally(gateway)

I would suggest making a Tag with the type of ‘Date’ that stores the time of the last transition from 1->0.

Then in your Boolean tag, write a tag-changed event script that reads:

if previousValue.value == 1 and currentValue.value == 0:
    system.tag.write("Path_to_date_tag", system.date.now())

So now you’ve got the time of that change. In your vision window to display the duration to the user, in an expression binding do something like:

secondsBetween({datetag}, now())

Which will display the raw integer seconds since the last 1->0 change. You could format that into a string as you like.

3 Likes