Tag Value Changed script not triggering in UDT

Ok. Consider this topic's solution:

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:

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