# Display counter based on two tag values

**URL:** <https://forum.inductiveautomation.com/t/display-counter-based-on-two-tag-values/16858>\
**Category:** Ignition\
**Created:** [February 2, 2018, 11:48pm UTC](https://forum.inductiveautomation.com/t/display-counter-based-on-two-tag-values/16858 "2018-02-02T23:48:10Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![bfuson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfuson/32/4597_2.png) [@bfuson](https://forum.inductiveautomation.com/u/bfuson)\
**Post date:** [February 5, 2018, 10:04pm UTC](https://forum.inductiveautomation.com/t/display-counter-based-on-two-tag-values/16858/3 "2018-02-05T22:04:42Z")

</div>

You might find this useful:

> [@Timer function that works gloabally(gateway)](http://forum.inductiveautomation.com/t/timer-function-that-works-gloabally-gateway/16849/4):
>
> 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…

---

_[View the full topic](https://forum.inductiveautomation.com/t/display-counter-based-on-two-tag-values/16858)._
