# Tag Value Changed script not triggering in UDT

**URL:** <https://forum.inductiveautomation.com/t/tag-value-changed-script-not-triggering-in-udt/113963>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [February 13, 2026, 5:02pm UTC](https://forum.inductiveautomation.com/t/tag-value-changed-script-not-triggering-in-udt/113963 "2026-02-13T17:02:27Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 13, 2026, 5:41pm UTC](https://forum.inductiveautomation.com/t/tag-value-changed-script-not-triggering-in-udt/113963/11 "2026-02-13T17:41:55Z")

</div>

Ok. Consider this topic's solution:

> [@Resettable runtime counter](https://forum.inductiveautomation.com/t/resettable-runtime-counter/91299):
>
> Hello, I'm trying to figure out how to create an expression for a runtime counter. I found this script that works: if({[~]P\_1\_RI.value}, if(IsGood({[~]P1\_RT.value}),{[~]P1\_RT.value},0)+1, if(IsGood({[~]P1\_RT.value}),{[~]P1\_RT.value},0)) However, I'm trying to figure out how I can add a 'reset' function that will allow the operator to reset the runtime counter to 0 if the button is pushed. Additionally, sometimes the operator will need to manually update the runtime counter and then the syst…

Note that using timestamps like this has a number of advantages over a counter tied to a timer:

- Only consumes Gateway CPU when a Perspective UI is actively watching, or the run/stop boolean changes. (A Vision UI can watch without any gateway load.)
- Preserves precision down to the update pace of the run/stop tag.
- Scales without risking tag event bottlenecks.

Edit: I knew I'd made a better example somewhere--took a moment to find it:

> [@Curiosity? Gateway Timer Event Scripts](https://forum.inductiveautomation.com/t/curiosity-gateway-timer-event-scripts/102368/9):
>
> As Ryan suggests, don't count in a timer event. The timing is not very precise. To get retention of prior time, you need at least two timestamps to hold state, updated when the signal changes. A stop timestamp, and an adjusted start timestamp. The start timestamp needs to be adjusted backwards from now() by the amount accumulated before. Drop these tags into a test folder to see how to set this up: { "tags": [{ "valueSource": "expr", "expression": "if(\n\t{[.]RTO\_Reset},…

In that example, the `RTO_Accum` expression tag is not required to be a tag. It can be moved to a UI expression (with suitable indirect tag bindings to retrieve the parts it needs).

---

_[View the full topic](https://forum.inductiveautomation.com/t/tag-value-changed-script-not-triggering-in-udt/113963)._
