1 Publication 1747-RM001G-EN-P - November 2008
Chapter
3
Comparison Instructions
This chapter contains general information about comparison instructions and
explains how they function in your application program. Each of the
comparison instructions includes information on:
• the instruction symbol.
• instruction usage.
About the Comparison
Instructions
Comparison instructions are used to test pairs of values to condition the
logical continuity of a rung. As an example, suppose a LES instruction is
presented with two values. If the first value is less than the second, then the
comparison instruction is true.
To learn more about the compare instructions, we suggest that you read the
Compare Instructions Overview that follows.
Table 3.1 Comparison Instructions
Instruction Mnemonic Instruction Name Purpose Page
EQU Equal Test whether two values are
equal.
3-2
NEQ Not Equal Test whether one value is not
equal to a second value.
3-2
LES Less Than Test whether one value is less
than a second value.
3-3
LEQ
Less Than or
Equal
Test whether one value is less
than or equal to a second value.
3-3
GRT Greater Than Test whether one value is greater
than another.
3-3
GEQ Greater Than or Equal Test whether one value is greater
than or equal to a second value.
3-4
MEQ
Masked
Comparison for Equal
Test portions of two values to see
whether they are equal.
Compares 16-bit data of a source
address to 16-bit data at a
reference address through a
mask.
3-4
LIM Limit Test Test whether one value is within
the limit range of two other
values.
3-5