Graphics Builder > Dynamic Associations > Define Dynamic Associations

Define Dynamic Associations

To define a dynamic association, enclose the association name between question mark (?) characters. You can also include the data type, though this is optional.

?<Association>?

?<Data Type> <Association>?

Everything between the question mark characters will be replaced at runtime with the associated value. The association may be referenced as many times as necessary on a graphics page.

Note: If you have upgraded and historically used numbers in your associations, these will continue to work as numbers are regarded the same as a name.

The data types for an association allow you to pass tags of the following types:

When the <Data_Type> is not specified, Citect SCADA will automatically use the relevant typecast variable type at runtime.

Note: Explicit type casting to BCD, BYTE, LONGBCD, UINT and ULONG types is not supported for the associated tag. Use automatic data type associations for these types. If using automatic data type associations, be aware that it may be more difficult to decipher error logs.

In the following example an association has been used in numeric expressions 1 to 3. The names used are "equip" and "outside_temp". As they are associations, the names have been placed within "? ?".

For Numeric expression 1 and 2, only part of the expression has been associated with a placeholder. For numeric expression 3, the whole expression has been replaced with an association.

This means at runtime, a variable tag, equipment name or 'equipment.item' reference will replace the associations "?equip?" and "?outside_temp?" in the expression.

You can also use the association with prefixes, suffixes and logical operators. For example:

Note: When using logical operators, use brackets or spaces in the dynamic associations. If brackets or spaces are not used, the compiler will produce an "Incompatible type" error message.

This will be expanded to the complete reference at runtime. For example, an association of "?equip?.Running" when associated with equipment named "Pump1" at runtime, will become "Pump1.Running".

Note: Tag elements (for example, Field, Override Mode or Control Mode) and Tag Items (for example, V, Q, T) are not supported for partial associations in dynamic associations.

See Also

Published June 2018