Home / Resources / How to use Indirect Tag Binding for Rapid Development

How to use Indirect Tag Binding for Rapid Development

Indirect tag binding is a type of data binding available in FactoryPMI 3.0. It allows the designer to bind a component’s property to any number of tags using one or more layers of indirection. This lets one create templated components and parameterized windows. A templated component is a component or group of components whose data bindings are relative to some properties of the component. A parameterized window is similar, the difference being that the entire window’s contents are relative to a parameter that is passed into the window when it is opened. Indirect tag binding makes creating these components and windows a snap. All you need to do is bind to a tag, and then choose the part of the tag path that changes, replacing it with a value from a property in the window.

To demonstrate indirect tag binding, suppose we had a tank farm with four tanks. Each tank has some properties, like level and temperature. Each tank also has an outlet pump, that can be controlled from the screen and has amperage associated with it. Here is how the tag structure would look in the SQLTags browser:

Our goal with indirection is to bind to tag paths like:

... where the "X" is replaced with 1-4. Let’s say we wanted all 4 tanks on the same screen. In this case we’ll set up a templated component, or rather, group of components. Put all the components you want to represent 1 tank in a container, like so:

These components were created simply by dragging the tags represented into the container. The pump is an image whose tint color is bound to the pump mode tag. To turn this container into a templated component, simply add an integer dynamic property to the container called "TankNum", and set its value to 1. Now modify each of the data bindings on the components’ properties from a direct tag binding like this:

... to an indirect tag binding like this:

To create this indirect tag binding, first browse for the tag: "Tank1/Level." Then, remove the "1" in "Tank1", and browse for your "TankNum" dynamic property. That’s it – your binding is now indirect, and will point to whichever tank is indicated by the value of "TankNum". Now all you need to do is copy and paste this container 4 times and change the value of TankNum appropriately, to create a screen like this:

Creating a parameterized window is just as easy. The only trick is that the dynamic property "TankNum" that controls the indirection for the bindings needs to be placed on the popup window’s Root Container. This lets you create a popup window like this:

Whenever you open this window, simply send it a value of 1 through 4 by passing the "TankNum" parameter in the navigation action. In this way, one popup window can be used for a number of devices.

About Inductive Automation
Inductive Automation pioneered the first full-featured web-launched HMI/SCADA system in the world. Its standards based, database-centric architecture receives accolades from plant managers, IT managers, and system integrators worldwide. With a commitment to software quality and technical support second to none, Inductive Automation is at the forefront of industrial software.

Jim Meisler
(800) 266-7798 x227
published: 04/30/14