New User: Creating Template and binding members of UDT to object

I’ve created a template and so far I’ve added just a ‘Moving Analog Indicator’. I’ll add more as I go. On the template Container I’ve added a Template Parameter called ‘Analog’ this maps to a UDT named P_AIN.

P_AIN is based off Rockwell PlantPAx and has Val, Val_HiHiLim, Val_HiLim, Val_LoLim, Val_LoLoLim, etc. On the ‘Moving Analog Indicator’ property Editor is there a way to bind automagically to the ‘Analog.Val_HiHILim’?

The only way I could come up with was to bind it to a expression manually and use {Analog Display.Analog::Val} but I had to manually add the ::Val part. I didn’t see a way to drill down through the bound UDT on the container and select the desired tag.

My assumption is that when I create an instance of this template I’ll have to put in the desired tag of type P_AIN such as TankTemperature.

Under binding, select property as the type and then drill into the UDT.

That’s one way to do it. We went down that route but our screens are really slow with a lot of Datatypes on screens.

I think the ‘new’ best practice is to use indirect binding. I have converted all of our templates to use indirect tag binding so you are not binding to the whole datatype only the members needed. They show this in the Inductive University training.

3 Likes

I second this. I have come into some projects that already use UDTs as parameters, and it definitely slows things down. I think it loads the entire UDT into the template or window. It also makes it more difficult if you have variations of a UDT - I haven’t had good luck passing a similar but not exact UDT as a different kind of UDT. If you pass around tagPaths, you aren’t loading entire UDTs, just a string. It’s also a lot more flexible for variations of the same UDT.

For nearly identical UDTs, you should use parent-child datatypes. Though your design should be perfect from the start, as it’s not possible to change the parent of an UDT once created (AFAIK).

The disadvantage of indirect tags is also the lack of drag-and-drop support, and the lack of browsing the tags.

Though as said, the speed difference is massive when using big UDTs. It looks like for every time you use a value of an UDT, the entire UDT is loaded.

I wonder whether IA will work on improving the usability of indirect tags, or if they will work on improving performance of UDT loading. Both seem possible IMHO.

I wondered about that. The UDT I created only had the tags I was using but I may try the other options and test.