Description

Property Binding is perhaps the most important concept to understand when designing a project using the Vision module. It is primarily through property binding that you bring windows to life, and have them do useful things. A property binding simply links one component's property to another on the same window.

Video recorded using: Ignition 7.7

Transcript

(open in window)

[00:00] Property Binding is perhaps the most important concept to understand when designing a project using the Vision Module. It is primarily through Property Binding that you bring windows to life and have useful things. So as you know, every component that you put onto Window has various properties that change the way that component looks and the way it behaves. So for example, if I take this cylindrical tank and put onto Window, it has various properties down here in the bottom left, one of which is called Value, that is the level of the tank. If I set that value to 50, you can see the tank level fill-up. Now the only way to make that property dynamic is to bind that property to some source, on the right-hand side of every single property is a Bind button, it looks like a database with a link on it. I click on that button to actually link this property to a tag, directly or indirectly, to another property in the same screen, to expression or calculation, as well as to an SQL query. The simplest of all the binding types is Property, I can link one property in the screen to another property in the same window. So, in this case, lets say I right below the tank, I put a slider component, and I want the value of the tank to be bound to the value of the slider. So whenever the slider value changes, the tank will reflect the same value. If I go up here to my tank, I go to the Value property on the right-hand side, click on the Bind button, I can select Property, going down to my slider and then selecting its value. It's really important when you're doing any binding, that the two data types match-up, from what your binding from to what your binding to. In my case they're both integers, so everything's okay. Soon as I press OK, you'll see the tank show the value of the slider, in the Property Editor in the bottom-left, you'll see that the Value property is now bold, indicating that it's bound to something. I can go into the bind type to see exactly what it's linked to. So if I go into Preview mode here and actually move the slider around, you'll see the tank level reflect whatever I change the slider to. Another way I can view this binding is actually going up here to View, Dependencies and Showing All, Ignition will show you exactly what's linked to what, this case a line's been drawn from the slider to the tank, letting me know the tank is bound to the slider. Go ahead and turn that off. Not only is property binding good for linking one property in the screen to another property in the same window, it's good to link a component to a property within a UDT. So, here for example, in my root container I have a UDT custom property added, that is a datatype called Tank. Inside my tank I have a tag called level_PV. I want to link the tank here to the level_PV of this UDT, and I'm going to use Property Bind to make that happen. So I go to my tank here, go back to the Value property, click on the Binding button, get 'em to select Property, in this case I'm going to go to my Tank UDT and select the level_PV that's inside of it. When I press OK, now it's liked to that value that's in the UDT. So Property Bind's really the simplest of all of 'em, linking one property in the screen to another property in the same window.

You are editing this transcript.

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