205
5-16-10 UNSIGNED COMPARE: CMP(028)
Ladder Symbol
Variations
! CMP(028)
Operand Data Areas
S
1
: Comparison word 1
CIO, G, A, T, C, #, DM, DR, IR
S
2
: Comparison word 2
CIO, G, A, T, C, #, DM, DR, IR
(
028
)
CMP S
1
S
2
When the execution condition is OFF, CMP(028) is not executed. When the ex-
ecution condition is ON, CMP(028) compares constants and/or the contents of
specified words as unsigned 16-bit binary data and changes the status of com-
parison flags according to the results.
After CMP(028) execution, the A50005 (GR), A50006 (EQ), and A50007 (LE)
flags turn ON and OFF as shown in the following table.
Comparison result
A50005 (GR)
A50006 (EQ)
A50007 (LE)
S
1
> S
2
ON
OFF
OFF
S
1
= S
2
OFF
ON
OFF
S
1
< S
2
OFF
OFF
ON
Note The immediate-refresh variation of CMP(028) can be used in simplex mode
only; it cannot be used in duplex mode.
Flags
ER (A50003):
Content of
*
DM word is not BCD when set for BCD.
GR (A40213), EQ (A50006), LE (A50007):
(Refer to tables above.)
5-16-11 DOUBLE UNSIGNED COMPARE: CMPL(029)
(
029
)
CMPL S
1
S
2
Ladder Symbol
Operand Data Areas
S
1
: First comparison word 1
CIO, G, A, T, C, #, DM,
S
2
: First comparison word 2
CIO, G, A, T, C, #, DM,
When the execution condition is OFF, CMPL(029) is not executed. When the ex-
ecution condition is ON, CMPL(029) compares constants and/or the contents of
specified sets of words as unsigned 32-bit data and changes the status of com-
parison flags according to the results. The content of S
1
and S
1
+1 is compared
to that of S
2
and S
2
+1.
After CMPL(029) execution, the A50005 (GR), A50006 (EQ), and A50007 (LE)
flags turn ON and OFF as shown in the following table.
Comparison result
A50005 (GR)
A50006 (EQ)
A50007 (LE)
S
1
+ 1, S
1
> S
2
+ 1, S
2
ON
OFF
OFF
S
1
+ 1, S
1
= S
2
+ 1, S
2
OFF
ON
OFF
S
1
+ 1, S
1
< S
2
+ 1, S
2
OFF
OFF
ON
Flags
ER (A50003):
Content of
*
DM word is not BCD when set for BCD.
GR (A40213), EQ (A50006), LE (A50007):
(Refer to tables above.)
Example
When CIO 000000 is ON in the following example, the content of CIO 0011 and
CIO 0010 is compared with that of CIO 0009 and CIO 0008 as binary data.
•
If the content of CIO 0011 and CIO 0010 is greater than that of CIO 0009 and
CIO 0008, then output CIO 002000 will turn ON.
Description
Description
Comparison Instructions
Section 5-16
Summary of Contents for CVM1D
Page 462: ...SYSMAC CVM1D Duplex System Programmable Controllers Operation Manual Revised August 2001...
Page 463: ...iv...
Page 465: ...vi...