You are here: Core Reference > Lists > Custom Lists > A List that Contains Information that is Relevant to a Particular Group Instance

A List that Contains Information that is Relevant to a Particular Group Instance

This example demonstrates how you might embed a List on a Mimic that is in a Group Template, in order that in each Instance of that Template, the Instance of the embedded List displays the entries that are relevant to that Instance.

ATTENTION: Be aware that the contents of a List embedded on a Mimic that is in a Group Template will always be empty (as that List is not ‘live’—only the Instances of the embedded List are ‘live’ and include any content). In order to configure and test out such an embedded List, we recommend that you initially include the Mimic in a ‘normal’ Group, while you ascertain the List’s content. Once the SQL query for that embedded List (and any other embedded Lists) is complete, you can convert the Group into a Group Template.

Example:

A particular ClearSCADA system comprises several ‘zones’ and has been configured using a series of Group Templates and Group Instances.

A Group Template ‘Zone Template’ is used to produce the ‘model’ configuration for each of the areas of plant (outstation and points) that exist in each zone. The Template contains an outstation called ‘Direct Outstation’, and the points that are associated with that outstation.

The Group Template also includes an overview Mimic that is to display a summary of the plant status for a single zone. The information, a summary of the points that are associated with the ‘Direct Outstation’ in a single zone, is to be displayed in List format.

The overview Mimic is displayed. An embedded List is inserted onto the Mimic (see Embed a Queries List on a Mimic in the ClearSCADA Guide to Mimics). The Embedded List Properties window is displayed automatically. The SQL query for the List’s content needs specifying in the window’s Query tab.

As a time saving exercise, to avoid typing in the complete SQL query manually, the SQL query for an existing List is used as a basis. To ascertain the SQL query that is presently used on a similar List, the Database Bar is used to locate an outstation elsewhere on the system. The Points List for the outstation is displayed by right-clicking on the outstation, and then selecting the Display Points option. The SQL window is displayed by right-clicking on the List and selecting the Edit Query option from the context-sensitive menu.The SQL window shows the SQL query that is used for the List:

The SQL query shows that:

  • The SELECT Clause forces the FullName column to remain in view on the List, regardless of whether any horizontal scroll bar is used to navigate the List’s entries.
  • The CDBPOINT table is the database table that is being queried for point data (as specified by the FROM Clause).
  • The WHERE Clause is restricting the records to those of the outstation, in a particular location on the system.
  • The ORDER BY Clause is used to display the List’s records in ascending order by FullName.
  • The SQL query is copied and pasted into the Query tab on the embedded List’s Embedded List Properties window.

    The SQL for the SELECT Clause is modified to include the fields that are required for the embedded List. (The ‘special’ fields Id, Foreground, and Background are retained so that the List entries are displayed using the appropriate system colors.)

    The SQL for the WHERE Clause is modified so that the embedded List only includes data for the points on the relevant outstation. As the List is embedded on a Mimic that is in a Group Template, the WHERE Clause in each Instance of the List needs to limit the List’s entries to only those points that are relevant to that particular Instance. To enable this, the SQL query is animated.

    To animate the SQL query, the engineer right-clicks on the Query tab and selects the Generate Animation option.

    The Generate Animation option animates the embedded List’s SQL query.

    In order to specify the required animation, the Embedded List Properties window is closed, and the Animations window opened. The Animations window includes an entry for the animated SQL query:

    The SQL expression is edited so that the embedded List displays only those points that are associated with the direct outstation in any one Instance of embedded List.

    In this particular case, the SQL for the WHERE Clause is changed to:

    WHERE "SourceName" = ''' + ".Direct Outstation.FullName" + '''

    The Embedded List Properties window is used to configure any other List properties that are to differ from the defaults (for example, the List’s header colors). (The settings that are specified here override the defaults that the List inherited from elsewhere in ClearSCADA.)

    The Mimic configuration is saved.

    As the List is embedded on a Mimic that is in a Template, no entries are displayed in the Template version of the embedded List. Therefore, an Instance of the embedded List is displayed, to verify that it includes the relevant records.

    (Remember that if any Instances of a Mimic are on display while the Template version of that Mimic is modified, the Mimic Instances will need redisplaying in order to reflect those changes.)

    (Also remember that once the SQL query for an embedded List has been animated, any changes to that SQL query have to be performed by editing the query’s expression in the Animations window, rather than the SQL query on the Query tab of the Embedded List Properties window.)

Further Information

Group Templates and Group Instances: see Group Templates and Group Instances in the ClearSCADA Guide to Core Configuration.

Ascertain which SQL Query is Presently used by a List.

SQL Query Structure in the ClearSCADA Guide to SQL.

Use the Embedded List Properties window: see Editing an Embedded Query List in the ClearSCADA Guide to Mimics.

Generate Animation menu option: see Query Tab (Embedded Query List), and see Sql, both in the ClearSCADA Guide to Mimics.

Using the Animations window: see Animations in the ClearSCADA Guide to Mimics.


ClearSCADA 2015 R2