system.tag.queryTagCalculations in UDT tag even script


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?

Tag events are not inside a project, and don’t have a default tag provider. Include your provider name in square brackets in each of your tag paths.

I tried with tagprovider as well, but still the same result. I will look into it some more, might be that I have missed something.