Template Parameters

Template parameters are specific to Template expressions (expressions that you can use to define how properties in a Group Instance derive their values from a Group Template).

Template parameters are the equivalent of tags. You use Template parameters in Template expressions instead of tags.

Template expressions support two predefined Template parameters:

Parameter Description
Name The given name of the Group Template or Group Instance to which the Template expression relates. The parameter excludes the path to that Group Template or Group Instance.
FullName The full name of the Group Template or Group Instance to which the Template expression relates. The full name includes the path to that Group Template or Group Instance in the hierarchical database structure.
Example:

LEFT(FULLNAME,4)

This Template expression uses the LEFT function to return the first 4 characters from the start of the Group Template or Group Instance's full name.

 

In addition to predefined Template parameters, you can configure and use your own 'custom' Template parameters. To do this, you use the Property Overrides window of the Group Template on which you want to use the parameters (see Use Template Expressions to Configure Property Values in the ClearSCADA Guide to Core Configuration).

The name of each Template parameter must adhere to the following limitations and restrictions:

You can use the Property Overrides window to define different types of Template parameter:

You assign each Template parameter a default value (the value that the parameter is to use if no other value is set for that parameter). You then use that parameter in one or more expressions in the Group Template, to define the values of properties of database items in the Group Instances that reference the Group Template. You then use the Edit Instance option of each Group Instance to set the Template parameters to the actual values that are required for a particular Group Instance.

Example 1:

A Group Template contains multiple digital points that each have an Address field. The points addresses are consecutive.

Rather than specifying each point address manually in each Group Instance, a series of Template expressions are used to populate the values of the Address fields, based on the value of the digital point with the lowest address.

A Template parameter is created with this configuration:

Parameter Name: FirstDigitalAddress
Parameter Type: 32 bit integer (signed)
Default Value: 0

The Address field of each digital point is configured to use a Template expression:

The expression used for the digital point with the lowest address is merely: FirstDigitalAddress
The expression used for the digital point with the next lowest address is: FirstDigitalAddress + 1
The expression used for the digital point with the next address is: FirstDigitalAddress + 2
and so on.

The configuration of the Group Template is saved.

The Edit Instance pick action is used to access the Property Overrides window on a Group Instance that references the Group Template. On this particular Group Instance, the lowest address of a digital point is 200, so the Default Value of the FirstDigitalAddress Template parameter is set to 200.

The configuration of the Group Instance is saved. The values of the expressions that use the FirstDigitalAddress parameter update automatically to use the new value. This results in the addresses of all of the digital points in the Group Instance being set to their required values as a result of the value of this one Template parameter being set.

The procedure is repeated for the other Group Instances that reference the Group Template.

 

Example 2:

A Group Template contains a number of points that need to reference a single outstation.

Rather than specifying the reference to the outstation manually for each point in each Group Instance, a Template expression is used to populate the reference fields automatically, based on the value of a Template parameter.

The Template parameter is given this configuration in the Group Template:

Parameter Name: Outstation
Parameter Type: DB Reference
The browse button next to the Default Value field is used to display a Reference browse window, from which the relevant outstation in the Group Template is selected.

The Outstation (OutstationId) field of each point is set to use the Template expression Outstation.

The configuration of the Group Template is saved.

The Edit Instance pick action is used to access the Property Overrides window on a Group Instance that references the Group Template. In the Parameters section of the Property Overrides window, the Default Value of the Outstation parameter is set refer to the relevant outstation in that Group Instance.

The configuration of the Group Instance is saved.

The Outstation (OutstationId) field of each point that is set to use the Template expression Outstation is updated automatically to refer to the specified outstation.

The procedure is repeated for the other Group Instances that reference the Group Template.

Further Information

Template Expressions

Configure Template Expressions and Template parameters in a Group Template: see Define which Property Values Derive from a Group Template in the ClearSCADA Guide to Core Configuration.

Set the Template parameter values in a Group Instance: see Configure the Properties that are Unique to the Items in a Group Instance in the ClearSCADA Guide to Core Configuration.


Disclaimer

ClearSCADA 2017 R3