Redundant instruction
This is a redundant instruction. It is replaced by: EQ
Compares the 16-bit data 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
16-bit area or 16-bit equivalent constant to be compared
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) |
||
16-bit data with sign |
s1<s2 |
Off | Off | On | # |
s1=s2 |
Off | On | Off | Off | |
s1>s2 |
On | Off | Off | # |
|
16-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