Special computation, Conditional expression – Yokogawa Button Operated MV2000 User Manual
Page 226
10-12
M-4660
Special Computation:
PRE( )
(Syntax) PRE(e1)
(Condition) Determines the previous value of e1.
HOLD(a):b
(Syntax) HOLD(a):b
(Condition) When a is zero, b is carried out to derive the computed value.
Otherwise, the previous computed value is held.
RESET(a):b
(Syntax) RESET(a):b
(Condition) When a is zero, b is carried out to derive the computed value.
Otherwise, the previous computed value of b is reset, and b is carried
out to derive the computed value.
CARRY(a):b
(Syntax) CARRY(a):b
(Condition) Only TLOG.SUM can be specified for b. If the computed value X of b is
less than a, the computed result is X. If X is greater than or equal to a,
the computed result is the excess (X – a).
(Explanation) When a value such as a flow rate is summed and the threshold value
is reached or exceeded, the sum value is reset while carrying over the
amount that exceeded the threshold value.
Expression Example
Expression that sums the values of channel 1 and resets the value when it reaches or
exceeds 10000
K01=10000
CARRY(K01):TLOG.SUM(001)
Examples of Invalid Expressions
002+HOLD(K01):TLOS.SUM(001)
HOLD is not at the beginning of the expression.
RESET(101.GT.K01):TLOG.SUM(001)+RESET(101.GT.K01):002
Reason: RESET appears twice in one expression.
Conditional Expression
[a?b:c]
(Syntax) [001.GT.K01?002:003]
(Condition) If the measured value of channel 1 is greater than constant K01, the
computed result is the measured value of channel 2. Otherwise, the
computed result is the measured value of channel 3.
Examples of Invalid Expressions
[001.GT.K01?002:003]*K02
Reason: Used in combination with another operator.
Nested Conditional Expressions
A conditional expression can be written in Expression
1
, Expression
2
, and Expression
3
in
the equation [Expression
1
?Expression
2
:Expression
3
]. For example, the following expression
is allowed: [Equation
1
?[Equation
2-1
?Equation
2-2
:Equation
2-3
]:[Equation
3
-
1
?Equation
3-
2
:Equation
3-3
]]
Expressions can be nested as long as the number of characters does not exceed 120
characters.