Method Expressions
Method expressions are a different type of expression. Unlike standard expressions that calculate a value, method expressions call a method on an item in the database to perform an action. For example, a method expression can be used to call the override method on a point.
There are many methods available for calling. You can use the database schema to find out which methods are available for each database item (see Working with the Database Schema in the Geo SCADA Expert Guide to the Database).
Method expressions are used by:
- Method Calls—You can enter a method expression in the Method field on the Method Call tab (see Stand-Alone Method Calls in the Geo SCADA Expert Guide to Core Configuration).
- Alarm Redirections—You can enter a method expression in the Method field on the Method Action tab of Forms (see Define the Method Action Details in the Geo SCADA Expert Guide to Alarm Redirection).
- Alarm Handling—You can enter a method expression for alarm handling methods (methods that are performed when an item changes alarm state). Enter a method expression in the Method field on the Alarm tab of the item's Form (see Configure a Method Action to Trigger at Every Alarm State Change in the Geo SCADA Expert Guide to Core Configuration).
- User Methods—These methods extend the syntax of method expressions to allow the user to be prompted for values (see User Method Expressions).
User methods are custom methods that can be associated with any database item (see Using the User Methods Tab to Define Custom Actions in the Geo SCADA Expert Guide to Core Configuration).
The following grammar is an extension of the grammar for Standard Expressions :
<method-expression> ::= <method-name> "(" [ <expression> { "," <expression> } ] ")"
Where:
<method-name>
is the name of the method to be executed, for example, Override<expression>
is a standard expression (which is an argument for the method).
The main difference with method expressions is that you start the expression with the <method-expression>
instead of a <simple-expression>
. The arguments for the method expression are standard expressions and use the grammar described in Standard Expressions .
Example:
The following expression is used to perform an override on a point.
Override(65)
The expression begins with the name of the method—the Override
method.
There is a single argument: 65
. This means that when the method is executed, it overrides the value of the point to 65.