140
FNC
10
D C M P P
S1
S2
D
1
2
M
3
○ ○ ○○
CMP K100 D100 M100
X20
S1
S2
D
X Y M S
D.b R.b
KnX KnY
KnM KnS
T C
D,R
V,Z
UnG
K,H
E
" $"
S1
S2
D
The CMP instruction will be enabled when X20 = “ON”.
If > (K100 > D100), then M100 = “ON”
If < (K100 < D100), then M102 = “ON”.
If = (K100 = D100), then M101 = “ON”
S1
S2
S1 S2
S1 S2
Operand
Devices
Compare
D occupies 3 consecutive devices
S1 : the compare value #1
S2 : the compare value #2
D : the compare result; occupying 3 consecutive points
D
S1 S2
Compare the content value of (Compare Value #1) with the value of (Compare Value #2), and save the
result in (Compare Result).
When X20=“OFF”, the instruction is inactive, the “ON”/“OFF” statuses of M100, M101 and M102 will remain as
same as the statuses before it is disabled.
Please use serial or parallel links of M100~M102 to generate the result as “≥”, “≤” or “≠”.