Compare Instructions

The compare instructions let you compare values by using an expression or a specific compare instruction.
Available Instructions
Ladder Diagram
Function Block Diagram
FBD Block
Structured Text
Not available
If you want to:
Use this instruction:
compare values based on an expression
CMP
test whether two values are equal
EQ
test whether one value is greater than or equal to a second value
GE
test whether one value is greater than a second value
GT
test whether the source is infinite
IsINF
test whether the source is not a number
IsNAN
test whether one value is less than or equal to a second value
LE
test whether one value is less than a second value
LT
test whether one value is between two other values
LIMIT
pass two values through a mask and test whether they are equal
MEQ
test whether one value is not equal to a second value
NE
Compare values of different data types, such as floating point and integer.
The bold data types indicate optimal data types. An instruction executes at its fastest and with it lowest memory requirements if all the parameters of the instruction use the same optimal data type, typically DINT or REAL.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.