Animating a Symbol Object to Perform a Specific Action
You can animate an object on a symbol so that it performs a specific action when it is selected. This type of pick action animation is referred to as a method.
When configuring a symbol, you need the method to apply to any item with which the symbol is associated. To do this, you need to set the expression for the PickType animation property to 5 (which corresponds to method) and set the expression for the PickParam to one of the following:
- For a method on the database item:
"Parameter:<name of group parameter>.ObjectLink"+'?<name of method action>'
- For a method on the aggregate for the database item:
"Parameter:<name of group parameter>.ObjectLink"+'?<name of aggregate>.<name of method action>'
- For a method on the alarm condition for the database item:
"Parameter:<name of group parameter>.ObjectLink"+'?<name of alarm condition>.<name of method action>'
- For a method on the alarm condition for the aggregate of a database item:
"Parameter:<name of group parameter>.ObjectLink"+'?<name of aggregate>.<name of alarm condition>.<name of method action>'
Where:
- <name of group parameter> is the name of a group parameter that you configure for the Mimic.
- ObjectLink is the name of another parameter that you have configured as a child of the group parameter.
- <name of method action> is the name of the method that will be performed when the Mimic object is selected. The name has to be identical to the name of the method in the database. Do not include the angle brackets < >.
- <name of aggregate> is the name of the aggregate in the database that provides the database item with access to the method. Do not include the angle brackets < >.
Database aggregates are special extensions to a database class that have their own names, fields, methods and alarm conditions. So, if a database item is part of a class that has an aggregate, the database item has access to the methods for its own class and the methods for the aggregate.
- <name of alarm condition> is the name of the alarm condition in the database that provides the database item with access to the method. Do not include the angle brackets < >.
Alarm conditions are similar to database aggregates in that they provide access to additional fields and methods (specific to alarms). So, a database item can have access to the methods of its own class and the methods for the alarm conditions. As the aggregates can also have alarm conditions, it is possible for a database item to have methods for its own class, methods for its alarm conditions, methods for its aggregate, and methods for the alarm conditions of its aggregate.
You should use the Database Schema to determine whether the method you require is stored for the database item, an aggregate, an alarm condition, or an alarm condition for the aggregate and then use the appropriate syntax. For more information, see Working with the Database Schema in the ClearSCADA Guide to the Database.
The parameter format we have described is suitable for actions that have no arguments ('options' or 'parameters'), such as Enable Alarms. For this specific example, the expression would be:
"Parameter:<name of group parameter>.ObjectLink"+'?Enable'
Where <name of group parameter> is the name of a group parameter that you have configured for the Mimic.
For actions that do have arguments, you need to add extra information. The format for the extra information is:
&<name of argument>="<value of argument>"'
Again, you do not enter the angle brackets < >. This additional information allows you to specify a value that is set when the Mimic object is selected. For example, if you wanted the Mimic object to Override the value of a point to 8 when the Mimic object was selected, you would define the expression as:
"Parameter:<name of group parameter>.ObjectLink"+'?Override&Value="8"'
For actions where you want to set multiple arguments, you simply repeat the extra information, using this format:
&<name of argument1>="<value of argument1>"&<name of argument2>="<value of argument2>"&<name of argument3>="<value of argument3>"'
Where argument 2 is the second set of extra information, argument 3 is the third set and so on. In all cases, you do not enter the angle brackets < > or the numbers.
To configure a parameter object so that it performs a specific action when selected, you need to:
- Configure a group parameter:
- Select Parameters in the View command group on the Graphics tab.
- In the Parameters window, select Add.
- In the Add Parameters window, define the name of the parameter and select the Group check box. The name of the group parameter will be an option that you can use to select the required expression so it is better to define a suitable name. For example, if the symbol is designed for use with the Acknowledge Alarms action, we suggest you name the group parameter Acknowledge Alarm. If the symbol is to be used with the Override action, name the group parameter Override and so on.
- Configure a child parameter named ObjectLink. The ObjectLink parameter has to be a child of the group parameter that you created in the previous step, and has to be named ObjectLink as this is the property that links the pick action menu of an item to the symbol.
- Double click on the parameter object to display its Polyline Properties window.
- On the General tab, select the Animations button to display the Animations window.
- Select the PickParam property on the Animations window.
- Select the Edit button to display the Expression window.
- Select the browse button to display a context sensitive menu.
- Select the option that is named the same as the group parameter you created in step 1.
A further menu is displayed. - Select the ObjectLink option.
The correct expression is shown in the Expression field. This links the Mimic object with the pick action menu of any item that is associated with the symbol. - Add the extra expression data for the specific action and any arguments. The extra expression data should be in the following format:
+'?<name of action>' &'<name of argument>="<value of argument>"
This format is explained at the start of this section. It defines the specific action that is to be performed when the object is selected on a Mimic, and also the specific argument (value, state and so on) that will be set (if applicable).
- Select the OK button to confirm the expression and close the Expression window.
- Select the PickType property.
- Select the Edit button to display the Expression window.
- Enter the number for the required PickType. The numbers are the same as those used for the PickParam (for a list of the PickParam numbers, see PickComment Animations)—for a Method, the number is 5.
- Select the OK button to confirm the expression and close the Expression window.
- Close the Animations window.
The parameter object is now animated to perform a specific action on any item that is associated with the symbol. The action will only be performed if it is suitable for the type of item that is associated with the symbol. For example, if the action was to acknowledge alarms for the item, and the item cannot have alarms, the action would not be performed.