Is there a way to load a UDT instance via script?

Is there a way to load a UDT instance via script? Or rather, I’d like to pass a UDT datatype as a parameter to a popup window but I want to use a different UDT instance than the one the component is bound to.

Any help or insight is greatly appreciated.

Use either the template canvas or the template repeater.

Hi, Thanks for the reply. I’m new to Ignition so I’m not understanding how I could utilize a template canvas or repeater for what I’m trying to do.

If i have a UDT instance on a window (say a valve) and I click on the valve and open a popup/faceplate, I can pass the UDT Datatype to the popup via a parameter without any issue, however, what I would like to do is bind the popup to a different UDT instance programmatically so that the popup can reference a more complete set of tags that exist in a different UDT instance.

If the tags are related, i.e. just more detailed, you can use a UDT Parent/Child relationship. Lets say the parent is an analog output and the child is that output plus the 4 and 20 mA scaling. The tag will be defined by the child UDT and will contain all the data but the template will use the parent UDT parameter and only display the analog output.

When you build the popup use the child UDT as the parameter and you will be able to access all the details.

Not sure if that helps or not

A few options:

A) Create a custom property, of type String, on your valve (and matching property on the popup window to pass it to) that has the tag path to the more complete UDT tag you are looking to use in the popup window. You can then pass this property to your popup window. From there you can use this tag path string in an Indirect Tag binding on a another custom property in the popup window that has the same data type as your complex UDT. (there is probably a better way to pass the name of the tag to the popup window)

B) If your Simple UDT has a similar name to your complex UDT, you can pass the TagPath property of your simple UDT to the popup window. You can then use the name in an indirect binding that you modify to match the name of your complex UDT (similar to option A)

C) Pass the parameters to the window via scripting, instead of the GUI interface. This will allow you to modify tag names and how you pass parameters as you see fit. How exactly depends on your UDT naming/setup.

I’m sure there are many other ways to do this but these were what I could think of off the top of my head.

Good luck!