User`s manual

12-16 Motion Mate DSM314 for Series 90-30 PLCs User's Manual
January 2001 GFK-1742A
12
Comparison Operators
The comparison operators form a relational assertion between two operands. The comparison
expression evaluates the conditional based on the operands signed integer value.
Table 12-5. Relational Operators
Operator Meaning
< Less than
>Greater than
<= Less than or equal to
>= Greater than or equal to
= Equal to
<> Not Equal to
Comparison operators may only be used as expressions in conditional statements, and only one
comparison operator may be used per expression.
IF source1 ComparisonOp source2 THEN
Comparison operators have these parts:
Part Description
source1 Any readable Boolean or 32-bit local logic variable or numeric
constant.
source2 Any readable Boolean or 32-bit local logic variable or numeric
constant.
ComparisonOp Any relational operator / Logical operator.
Remarks
The following table contains a list of the comparison operators and the conditions that determine
whether the result evaluates to True or False:
Table 12-6. Local Logic Comparison Operators
Relational Operator True if False if
Less than < source1 < source2 source1 >= source2
Less than or equal to <= source1 <= source2 source1 > source2
Greater than > source1 > source2 source1 <= source2
Greater than or equal to >= source1 >= source2 source1 < source2
Equality = source1 = source2 source1 <> source2
Inequality <> source1 <> source2 source1 = source2
Null Operator (IF
Variable THEN.)
N/A
Variable is Non-Zero Variable is Zero
Bitwise Logical Operators
BWAND,
BWOR,BWXOR,
BWNOT
Result is Non-Zero Result is Zero