204
5-16-9 DOUBLE SIGNED BINARY COMPARE: CPSL(027)
(
027
)
CPSL 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, CPSL(027) is not executed. When the ex-
ecution condition is ON, CPSL(027) compares constants and/or the contents of
specified sets of words as signed 32-bit binary data and changes the status of
comparison 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 CPSL(027) 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
The range that can be specified for comparison is 80000000 to 7FFFFFFF (i.e.,
-2,147,483,648 to 2,147,483,647 in decimal).
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 D00002 and
D00001 is compared with the content of D00006 and D00005 as signed binary
data.
•
If the content of D00002 and D00001 is greater than that of D00006 and
D00005, then A50005 (GR) will turn ON, causing CIO 002000 to be turned
ON.
•
If the content of D00002 and D00001 is equal to that of D00006 and D00005,
then A50006 (EQ) will turn ON, causing CIO 002001 to be turned ON.
•
If the content of D00002 and D00001 is less than that of D00006 and D00005,
then A50007 (LE) will turn ON, causing CIO 002002 to be turned ON.
Address
Instruction
Operands
00000
LD
000000
00001
CPSL(027)
D00001
D00005
00002
AND
A50005
00003
OUT
002000
00004
AND
A50006
00005
OUT
00201
00006
AND
A50007
00007
OUT
002002
0124
D00002
D00001
805C
D00006
D00005
23BD
AF82
Comparison
Comparison Results
A50005 (GR)
ON
A50006 (EQ)
OFF
A50007 (LE)
OFF
Description
Comparison Instructions
Section 5-16
(027)
CPSL D00001
D00005
0000
00
0020
00
A50005
(GR)
0020
01
A50006
(EQ)
0020
02
A50007
(LE)
Summary of Contents for CVM1D
Page 462: ...SYSMAC CVM1D Duplex System Programmable Controllers Operation Manual Revised August 2001...
Page 463: ...iv...
Page 465: ...vi...