# 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:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julio.Bautista](https://avatars.discourse-cdn.com/v4/letter/j/3bc359/32.png) [@Julio.Bautista](https://forum.inductiveautomation.com/u/Julio.Bautista)\
**Post date:** [February 2, 2018, 11:48pm UTC](https://forum.inductiveautomation.com/t/display-counter-based-on-two-tag-values/16858/1 "2018-02-02T23:48:10Z")

</div>

I have two Boolean tags that based on their values I would like to display a running counter. What would be the best way to deal with this.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [February 5, 2018, 1:18pm UTC](https://forum.inductiveautomation.com/t/display-counter-based-on-two-tag-values/16858/2 "2018-02-05T13:18:58Z")

</div>

Hi Julio, welcome to the forums!

We’re going to need more information. The better you explain your question, the better out answers will become. 🙂

---

<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…
