40
Valid data types:
d
Discrete Input
a
Analog Channel
r
Relay State
n
Sensor
v
Positive Integer Constant
s
System Alarm
Valid operations:
+
Addition
-
Subtraction
*
Multiplication
/
Division
1
>
Greater than
<
Less than
|
Conditional Halt
2
1. Division is NOT executed if the denominator's absolute value is less than 1!
2. An equation is evaluated until it reaches the Conditional Halt. If the running value at that point is zero, then the
evaluation stops, otherwise the evaluation continues as a new equation.
How equations are evaluated:
Calculations are performed from left-to-right until the end of the equation is reached. As the equation is parsed, each
token's value is pushed onto a stack until an operator is found. When an operator is found, the previous 2 values are
popped from the stack and are used to perform the operation (the first item popped is the SECOND operand). The
result of the operation is then pushed onto the stack. This repeats until the end of the equation is reached. An
equation is valid only if there is exactly ONE item left in the stack when the end of the equation is reached.
Example of how an equation is evaluated:
Equation: a8 a5 a6 + * a4 -
Input
Operation
Stack
Comment
a8
Push value
a8
a5
Push value
a5
a8
a6
Push value
a6
a5
a8
+
Add
(a5+a6)
a8
Pop a6 and a5, add them, push result to stack
*
Multiply
a8*(a5+a6)
Pop (a5+a6) and a8, multiply them, push result to stack
a4
Push value
a4
a8*(a5+a6)
-
Subtract
a8*(a5+a6) - a4 Pop a4 and a8*(a5+a6), subtract them, push result to stack
In this example, after the subtraction there is only ONE item left in the stack (which is the result of all of the
previous computations), mak ing this a valid equation.
Summary of Contents for NetGuardian LPG D-PK-NGLPG
Page 74: ...70 AState 6 For specific alarm points see Table B6...
Page 79: ...75...