Indirect Tags
NOTE: Tags do not apply to Template expressions, instead you use Template Parameters.
Indirect tags are only supported by expressions that are evaluated by the client (see Evaluation of Expressions).
Indirect tags are tags that represent a property that derives its value from another tag. For example, an indirect tag can be used to represent the current value property, but for different database items.
A common use of indirect tags is to allow a Mimic to display certain properties, with the data source of those properties changing when a user selects a button. For example, in the electricity industry, a Mimic is often configured to present the data for the three phases of an electricity system. The Mimic shows the values for 1 phase at a time, with indirect tags being used to allow users to switch the data source from phase 1 items, to phase 2 or phase 3 items at the press of a Mimic button.
When using indirect tags, there are two factors to consider:
- The indirect tag feature provides users with a way of changing the data source for a Mimic item. For example, a Mimic could use an indirect tag to animate a text box to show the current value of an item. The item that is used as the data source changes when a user selects an animated button.
Indirect tags are designed to have their data source changed by user interaction. This is because users are unlikely to change the data source excessively; frequent changes or updates to the data source for an indirect tag can place a high load on the system and cause slower system performance.
For this reason, you should avoid using indirect tags that reference properties that update frequently and automatically. For example, during communications, the CurrStatsMessages tag of a channel updates frequently and automatically. Consequently, if an indirect tag references the CurrStatsMessages tag, it means that when the channel is being used for communications, the indirect tag will also have to update its value frequently. This can place a high load on the system and could affect system performance.
- If an embedded Mimic uses indirect tags to reference Mimic parameters, disable the Shared with other Embedded Mimics setting.
If you enable the setting, the tags in the OPC group will update frequently and may cause slow system performance. For more information, see Shared with Other Embedded Mimics in the ClearSCADA Guide to Mimics.
To use an indirect tag, you have to enclose the expression that is used to provide the values for the tag in square brackets [ ]. The expression can include any of the expression functions and has to define a valid OPC tag.The result of the expression within the square brackets is used to define the source of the value for the tag.
Example:
Using Indirect Tags to Toggle the Values shown on a Mimic
The temperature in a control room is measured by two sensors. One sensor measures the temperature in Celsius and the other measures in Fahrenheit. Both of these sensors are represented by points in the ClearSCADA database (named 'Celsius' and 'Fahrenheit' respectively).
A Mimic contains a text box that displays the temperature of the control room. There is a button on the Mimic that toggles the text box so that it displays the value for the 'Celsius' point or the value for the 'Fahrenheit' point. This is achieved by using an indirect tag in an animation. The indirect tag allows the text box to show the CurrentValue property, but for different points.
The text box uses this animation expression for its Value property:
[IIF("Indirect Tags Group.Units.CurrentState" =0,'Indirect Tags Group.Celsius','Indirect Tags Group.Fahrenheit') +'.CurrentValue']
This animation instructs ClearSCADA to calculate the result of the expression and then use that result as the source of the value that is shown in the text box. The square brackets [] instruct ClearSCADA to use an indirect tag so the result of the expression defines the source of the value for the animation property. If the square brackets were not included, the result of the expression would be used as the actual value for the animation property.
In this case, ClearSCADA determines that if the CurrentState value of the 'Units' point (which is stored in a Group named 'Indirect Tags Group') is 0, then the result is the value that is stored in the CurrentValue tag for the 'Celsius' point. If the CurrentState value of the 'Units' point is anything other than 0, the result is the value that is stored in the CurrentValue tag for the 'Fahrenheit' point.
So, if the 'Celsius' point has a current value of 15 and the 'Units' point is in state 0, the text box displays the value that is stored in the CurrentValue tag of the 'Celsius' point, that is it displays 15.
If the 'Units' point is in state 1, the text box displays the value that is stored in the CurrentValue tag of the 'Fahrenheit' point, that is it displays 59.
To allow the user to toggle between Celsius and Fahrenheit, a button on the Mimic is configured to have a method pick action that changes the state of the 'Units' point. So, when the button is pressed, it toggles the state of the 'Units' point and in turn, this toggles the value that is shown in the text box. The Text property of the button is also animated so that it shows 'Celsius' if the 'Units' point is in state 0 or 'Fahrenheit' if the 'Units' point is in state 1.