Templates and udt tags

We have recently discovered that when a template access a udt that all of the tags within the udt are subscribed/polled even if they are not referenced in the template. Our project uses an object oriented approach and our objects/udts can be large. For example, say we have a valve object that has all tags associated with the valve including indications, controls, setpoints, actuation timers, alarms, etc… The number of tags can easily exceed 200 for some of our objects. If just a single tag within the udt is referenced in a template, the entire udt tag structure is polled. This can quickly bring our large 32 core server to its knees if we have around 50 valves on the screen just simply displaying open/closed indications.

I’m not sure if this was the intent when udt’s were being developed but it would sure be nice if when a template referenced a single tag within a udt that just that tag was reference/subscribed by the system.

I also realize that there is a work around for this by basically passing in a string that represents the path to the udt object. In my opinion, this is a significant limitation of udt’s and doesn’t not support drop targets.

Is there any plan to optimize how udt’s are called/referenced/subscribed when utilized in templates?

Yes… this is a known limitation of UDTs and templates. The work around is to use a string reference in an expression to read just the tag.value that you care about.

When our UDTs get too big, we put the metadata in SQL and limit the child tags in the UDT to just those that require alarms, history and process values.



1 Like

You can also use UDT inheritance.

For example: make a udt with only the status variables of the valve. Then make another udt that have for parent type the previous one, and add control variables, set points, etc.

You can use the first UDT as drop target for a template that ONLY display the status of valve in screens, but for more complex visualization (for example, a popup window), use a string and tag indirection.

The good thing on this is that, if you make a instance of the complete UDT and drag on the screen, you can select the template that only use the basic part of that UDT and not the complete part.

Hope I made me understand.


Thank you for the information on work arounds. I had forgot about udt inheritance. I think I like this approach the best. Again, thank you guys for your help.

So I wished I had seen this before creating all of my templates!! LOL

It would be interesting to find out how this was verified and tested. It seems all my udt tags are subscribed to wether they are displayed on a window or not. I have converted my templates to use indirect tags from a string “tagname” parameter.
I wonder if the entire udt is put on scan (subscribed to) if there is a single tag with history enabled for it?