Download CML User's Guide

Transcript
Chapter 6
CML List
6.8. Logic Operators
Operator Functions
Format
Examples
Description
And(&&) Operator performs a logical conjunction on two
Boolean operands.
Result is True if and only if both operand1 and operand2
evaluate to True.
The following table illustrates how result is determined.
&&
And
[operand1] && [operand2]
operand1
TRUE
TRUE
FALSE
FALSE
operand2
TRUE
FALSE
TRUE
FALSE
the value of result
TRUE
FALSE
FALSE
FALSE
I4.1 && I3.2 Ex.) If I4.1=TRUE, I3.2=TRUE, then result is TRUE
Or(||) Operator performs an inclusive logical disjunction
on two Boolean operands.
Result is False if and only if both operand1 and operand2
evaluate to False.
The following table illustrates how result is determined.
||
Or
[operand1] || [operand2]
operand1
TRUE
TRUE
FALSE
FALSE
I4.1 || I3.2
operand2
TRUE
FALSE
TRUE
FALSE
the value of result
TRUE
TRUE
TRUE
FALSE
Ex.) If I4.1=FALSE, I3.2=FALSE, then result is FALSE
Not(!!) Operator performs a logical negation on a Boolean
operand.
The following table illustrates how result is determined.
operand
TRUE
FALSE
Ex.) If I3.2=TRUE, then result is FALSE
!!(I3.2)
I4.1 && !!(I3.2)
!!
Negation
the value of result
FALSE
TRUE
If I4.1=TRUE, I3.2=FALSE, then result is TRUE
[ Correct example ]
I2.1 && I4.1 && !!(I3.1), O1.1, F1.1
!!(operand)
If Input Signal 2 and Input Signal are ON(TRUE),
and Input Signal 3 is OFF(FALSE),
then Output Signal 1 turns ON(TRUE).
Otherwise Output Signal 1 is OFF(FALSE).
[ Incorrect example ]
I2.1 && !!(I3.1) && I4.1, O1.1, F1.1
* The next character following && !!( ) strings should
be "," in a statement.
I2.1 && !!(I3.1) && !!(I4.1), O1.1, F1.1
* Multiple Not(!!) Operators are not permissible in a
statement.
138