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

<div class="post-metadata">

**Author:** ![kayla.hebert](https://avatars.discourse-cdn.com/v4/letter/k/838e76/32.png) [@kayla.hebert](https://forum.inductiveautomation.com/u/kayla.hebert)\
**Post date:** [February 13, 2026, 5:02pm UTC](https://forum.inductiveautomation.com/t/tag-value-changed-script-not-triggering-in-udt/113963/1 "2026-02-13T17:02:27Z")

</div>

Hi all, wondering if you could provide some help with the issue I’m facing.

**Implementation** : I’ve created a Reference Tag to the System→Gateway→CurrentDateTime in a UDT definition. I’ve then created a Script under Value Events → Value Changed.

**Behavior** : When I do this with a generic Ref Tag in my Tag Provider, it works as expected. However, when I update my UDT to have an identical Ref Tag, the Value Change script doesn’t fire. I’ve verified that both Ref Tag values are reading the time second by second as the System’s clock increments.

[TagProvider]TestTags/GlobalTimerReferenceTag → works

[TagProvider]TestTags/TestUDTInstance/GlobalTimerReferenceTag → doesn’t work

**Other Notable Behavior** : I’ve noticed that if I have multiple Ref Tags defined identically in the same provider, they’ll all work (i.e. [TagProvider]TestTags/GlobalTimerReferenceTag, [TagProvider]TestTags/GlobalTimerReferenceTag2, and [TagProvider]TestTags/DummyDir/GlobalTimerReferenceTag3 will all trigger as expected).

**Script** :

I’ve dumbed the script down to just writing a Gateway error message to isolate the problem:

```python
def valueChanged(tag, tagPath, previousValue, currentValue, initialChange, missedEvents):
	#log stuff
	logger=system.util.getLogger("logger")
	logger.error("TESTING ONLY: value change event script fired for: {0}".format(tagPath))

```

**Context** : I am trying to create an equipment uptime counter for maintenance purposes in Perspective (so it’s operator driven, not device driven). I would like to stick with this implementation if I can, but I understand there may be different ways to implement this, so I’m open to suggestions if this is a limitation in Ignition.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 13, 2026, 5:04pm UTC](https://forum.inductiveautomation.com/t/tag-value-changed-script-not-triggering-in-udt/113963/2 "2026-02-13T17:04:22Z")

</div>

This is silly, but can you modify your logging statement so it doesn't use the format function - in particular, so that string doesn't have curly brackets in it?

---

<div class="post-metadata">

**Author:** ![kayla.hebert](https://avatars.discourse-cdn.com/v4/letter/k/838e76/32.png) [@kayla.hebert](https://forum.inductiveautomation.com/u/kayla.hebert)\
**Post date:** [February 13, 2026, 5:08pm UTC](https://forum.inductiveautomation.com/t/tag-value-changed-script-not-triggering-in-udt/113963/3 "2026-02-13T17:08:48Z")

</div>

Not silly, at this point I’ll try anything 🙂

Modified the UDT definition and verified script propagated to my instance. Not showing in Gateway logs still (other tags still do).

 ![Screenshot 2026-02-13 100626](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/5/05f85bb97d07f967b13cd923d0065ebf3d17eb34.png)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 13, 2026, 5:09pm UTC](https://forum.inductiveautomation.com/t/tag-value-changed-script-not-triggering-in-udt/113963/4 "2026-02-13T17:09:57Z")

</div>

Hmm, not sure then. I would have expected that to work.

There's an open ticket (IGN-8411) about the curly brackets in UDT scripts breaking things.

You might have to call support and let them take a look.

---

<div class="post-metadata">

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

</div>

I do something similar, instead of referencing a tag outside of the UDT you can just create a trigger tag inside of the UDT and update the tag at a set rate.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/f/7f43ccafbe78cfe53ef86331d1eb34897116627b.png)

---

<div class="post-metadata">

**Author:** ![kayla.hebert](https://avatars.discourse-cdn.com/v4/letter/k/838e76/32.png) [@kayla.hebert](https://forum.inductiveautomation.com/u/kayla.hebert)\
**Post date:** [February 13, 2026, 5:13pm UTC](https://forum.inductiveautomation.com/t/tag-value-changed-script-not-triggering-in-udt/113963/6 "2026-02-13T17:13:31Z")

</div>

Ok - do you have any other recommended approaches to work around this in the meantime? I’m new to Ignition development, so while I can probably figure out something, I’d like to get something working for now and move on.

---

<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:14pm UTC](https://forum.inductiveautomation.com/t/tag-value-changed-script-not-triggering-in-udt/113963/7 "2026-02-13T17:14:44Z")

</div>

> [@kayla.hebert](#):
>
> equipment uptime counter

Using a tag valueChange event for this is a terrible approach, fwiw. Consider storing a start timestamp and a boolean run flag in a pair of memory tags. Then the UI can use an expression based on `secondsBetween({path/to/tag}, now())` to supply the live uptime to an operator.

---

<div class="post-metadata">

**Author:** ![kayla.hebert](https://avatars.discourse-cdn.com/v4/letter/k/838e76/32.png) [@kayla.hebert](https://forum.inductiveautomation.com/u/kayla.hebert)\
**Post date:** [February 13, 2026, 5:14pm UTC](https://forum.inductiveautomation.com/t/tag-value-changed-script-not-triggering-in-udt/113963/8 "2026-02-13T17:14:56Z")

</div>

Nice, I’ll try this out right now. Thanks.

---

<div class="post-metadata">

**Author:** ![kayla.hebert](https://avatars.discourse-cdn.com/v4/letter/k/838e76/32.png) [@kayla.hebert](https://forum.inductiveautomation.com/u/kayla.hebert)\
**Post date:** [February 13, 2026, 5:23pm UTC](https://forum.inductiveautomation.com/t/tag-value-changed-script-not-triggering-in-udt/113963/10 "2026-02-13T17:23:09Z")

</div>

This doesn’t account for other downtime windows. In other words, equipment runtime isn’t necessarily time since last reset…it may have other factors where we need to stop the counter. Thanks for your input though!

---

<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).

---

<div class="post-metadata">

**Author:** ![kayla.hebert](https://avatars.discourse-cdn.com/v4/letter/k/838e76/32.png) [@kayla.hebert](https://forum.inductiveautomation.com/u/kayla.hebert)\
**Post date:** [February 13, 2026, 5:54pm UTC](https://forum.inductiveautomation.com/t/tag-value-changed-script-not-triggering-in-udt/113963/12 "2026-02-13T17:54:39Z")

</div>

Great and with some additional work on my end (a bit of a state machine that I’ll need to use to create a simple boolean running), this will work. Thanks for adding the bullet list, that’s extremely helpful.
