Redundant instruction
This is a redundant instruction. It is replaced by: EQ
Compares the 32-bit data or 32-bit equivalent constant specified by s1 with one specified by s2 if the trigger EN is in the ON-state. The compare operation result is stored in the system variables sys_bIsGreaterThan (> flag), sys_bIsEqual (= flag), sys_bIsLessThan (< flag) and sys_bIsCarry (carry-flag).
Input
32-bit equivalent constant or 32-bit area
If the required data type is supported, we recommend using the IEC instruction of the comparison instructions.
The variables s1 and s2 have to be of the same data type.
Data | Comparison between s1 and s2 | Flags |
|||
sys_bIsGreaterThan (>flag) | sys_bIsEqual (=flag) | sys_bIsLessThan (<flag) | sys_bIsCarry (carry-flag) | ||
32-bit data with sign |
s1<s2 |
Off | Off | On | # |
s1=s2 |
Off | On | Off | Off | |
s1>s2 |
On | Off | Off | # |
|
32-bit data without sign |
s1<s2 |
# |
Off | # |
On |
s1=s2 |
Off | On | Off | Off | |
s1>s2 |
# |
Off | # |
Off |
# turns ON or OFF depending on the conditions