Top | Previous | Next |
Custom Properties |
Most Vision components support custom properties. This means that in addition to the normal properties of the component, you can add your own properties. You can think of these properties like your own variables in the window. How to use Custom Properties Custom properties are extremely useful and are integral to creating maintainable projects using Ignition Vision. They let you turn a "plain" component into one customized for your particular use.
To add a custom property, open up the Custom Property Customizer on a component that supports it. This is a simple customizer that lets you edit a table of the custom properties for the component. When you hit OK, you'll notice the custom properties you added displayed in the Property Editor in blue. You can use these properties like any others - with data binding, scripting, styles, etc. Example Let's look at an example that will use the custom properties and the Styles feature together. Take the lowly Label component. It seems pretty plain at first - it just displays a String. Of course, you can use its foreground color, background color, and border to make it look interesting. Put an integer custom property on it called state, and bind that property to a discrete state tag coming out of a PLC. Now use the state to drive its Styles configuration to make the component look different and display different things based on the state being 0, 1, or 2 (maybe for a Hand/Off/Auto indicator) Now, we could have used the Multi-State Indicator from the get-go, but understanding this example will let you create your own types of components by combining the existing components in creative ways. Root Container Custom Properties Properties on the window's Root Container are special in that they double as a window's parameters. See Parameterized Windows for more. |