SMP Gateway User Manual • 171
17.1.4.1 Data Point Names in Expressions
To use a data point in an expression, simply type the name of the data point. Make sure to include
the prefix, if applicable.
A data point name used in an expression must adhere to the following Visual Basic-like notation:
It must begin with a letter.
It can include alphanumeric characters (A-Z, a-z, 0-9), the underscore separator " _ " (without
the quotes), and special characters, such as a period.
If the data point name contains a special character, it must be surrounded by the delimiter
character " (the quotation mark). For example, a physical data point name of T5.APHA must be
declared as "T5.APHA".
Here are some examples of valid expressions:
120 + ( CurrentPoint * 0.02 * ( Rand() - 1 ) )
( 0.85 "T5.APHA" * "T5.KVAB" ) / 1000
"1B17.MA" AND ("120-1.MA" AND NOT "120-1.MB" ) AND "1B1.MA"
Imbalance("T5.APHA", "T5.APHB", "T5.APHC")
17.1.4.2 Comments in Expressions
Expressions can span several lines. To insert a comment into an expression, put a single quote at
the beginning of the line.
For instance:
' Calculates the imbalance of transformer #5
Imbalance("T5.APHA", "T5.APHB", "T5.APHC")
17.1.4.3 Condition Statements
You can use the following condition statements in expressions:
Statement Description
If <condition> Then
<expression>
Endif
Evaluates the specified expression if the logical condition is true.
If <condition> Then
<true expression>
Else
<false expression>
Endif
Evaluates the expression specified after the "THEN" if the
logical condition is true, or evaluates the expression specified
after the "ELSE" if the logical condition is false.
Note that the expression can contain several embedded IF and
ELSE statements, in which case each ELSE statement is
associated with the IF statement closest to it.