I want to add some tag-calculation values to my UDT, based on the process value inside each UDT instance. I created a timer script that toggles a tag each hour. This tag is “mirrored” inside each UDT using an expression tag.
The thought was to add a tagchange script on this tag, that would run system.tag.queryTagCalculations to return max,min,avg each hour.
The script runs fine when using the Script Console, but running inside the UDT it returns “null” to all the calculated values. It seems like the tagpath to the process value is invalid. But when I run getLogger() and print the tagpath, I can’t see anything wrong.
I believe it may be some kind of timing issue. Because if I run the same script, but directly at the process value tag, It works as intended. But running this script each time the process value changes, is kind of overkill.
Has anyone experienced similar behavior with tag change scripts inside UDT’s?