Top  | Previous | Next

Indirect Bindings

Making bindings indirect is an important part of the binding system. Indirect Tag, Expression, and SQL Query bindings can all be made indirect. All this means is that what the binding is bound to can be changed based upon the value of something else.

 

For example, instead of binding straight to a tag's path, like

[TagProvider]MyPlant/EastArea/Valves/Valve4/FlowRate

you can use other properties to make that path indirect. Suppose the "area" and valve number that we were looking at was passed into our window via parameter passing. Then we might use those parameters in the tag path, like this:

[TagProvider]MyPlant/{1}Area/Valves/Valve{2}/FlowRate

{1}=Root Container.AreaName

{2}=Root Container.ValveNumber

 

Now our binding will alter what tag it is pointing to based upon the values of those root container properties.

 

Making query bindings indirect, or dynamic, is so common that there are probably more indirect query bindings than direct ones. All this means is that the query is calculated dynamically. A common example of this would be to use a dynamic start date and end date in a query. Suppose we had a Classic Chart that we're binding to a range of history, and a Date Range that we wanted to have the operator use to select a time period. Then we could use an indirect query binding like this:

SELECT
   t_stamp, flow_rate, amps
FROM
   valve_history
WHERE
   t_stamp >= '{Root Container.DateRange.startDate}AND
   t_stamp <= '{Root Container.DateRange.endDate}AND
   valve = {Root Container.ValveNumber} AND
   area = '{Root Container.AreaName}Area'

 

See also:

Parameterized Windows