![DPS Telecom D-PK-NG224-12003 User Manual Download Page 50](http://html1.mh-extra.com/html/dps-telecom/d-pk-ng224-12003/d-pk-ng224-12003_user-manual_2525690050.webp)
46
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.
Equation: d1 d2 + d3 * r1 =
Input
Operation
Stack
Comment
d1
Push value
d1
d2
Push value
d2
d1
+
OR
(d1+d2)
Pop d1 and d2, OR them, push result to stack
d3
Push value
d3
(d1+d2)
*
AND
(d1+d2)*d3
Pop (d1+d2) and d3, AND them, push result to stack
r1
Push value
r1
(d1+d2)*d3
=
Assign Value r1=(d1+d2)*d3
Pop (d1+d2)*d3 and r1and assign value to r1
In this example, after the assignment, 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 D-PK-NG224-12003
Page 9: ...5...
Page 11: ...7 Optional Shipping Items Available by Request 3 1 Small WAGO connector 2 802 01020 00...
Page 16: ...12 66Block diagrams 6 3 66 block pinout for Amphenol 1 TTL Discretes 1 24...
Page 17: ...13 66 block pinout for Amphenol 2 Controls 1 2...
Page 77: ...73...
Page 78: ......