Parameterized Popup Window and UDTs


Learn how to pass in entire UDTs into a popup window to take advantage of all of the Tags inside of the UDT at once.

Video recorded using: Ignition 8.1


(open in window)

[00:00] In this lesson, I'll show you how it's possible to pass an entire UDT instance as a parameter to a pop-up window. You can see in my designer that I have a UDT definition called Tank. I also have a pop-up window called Tank Popup. and I'll show you how I'm passing my UDT to this pop-up. If I right click the root container of my pop-up, and go to Custom Properties, you can see I have a custom property called Tank and the data type for this property is also called tank. if I click the drop-down for this type You can see that I have the option of all of the standard property types as well as user-defined types, which is what my tank property is. My pop-up window is ready to accept a UDT parameter. If I move the mouse over to the Property Editor for the Root Container, we can see the benefit of doing this. I'll click the magnifying class on the tank property and it will show all the properties or tags that are available to me within my tank UDT.

[01:04] An example of this in action would be my multi-state button on the pop-up as you can see the properties or tags of the tank UDT are now available to bind to and I've set up a bi-directional binding on the HOA tag. I'm trying to pass the tank UDT to my pop-up window so I'll go into my Tank template which is opening my pop-up. I'll open up the Custom Properties of the template and you'll notice that it has this same exact tank type property. I'll open up the Scripting window and you can see that it's opening my pop-up and it's passing the tank UDT as a parameter. If I go into the binding you can see the tank property here. I'll head over to the client to test this out. Each of these tanks is an instantiation of the tank template we just looked at. The components needs templates are bound to tags within the UDT's assigned to them.

[02:05] So when I click one of these templates, it fires the script to open the pop up window and passes that UDT as a parameter. That assigns the same UDT instance to the tank custom property on the root container of the pop-up. Then each of these components in the pop-up are bound tags within that UDT, which allows me to access and display more details about the tank.

You are editing this transcript.

Make any corrections to improve this transcript. We'll review any changes before posting them.