EasyManua.ls Logo

Omron CP - PROGRAMMING MANUAL 05-2007 - Page 256

Omron CP - PROGRAMMING MANUAL 05-2007
1175 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
223
Comparison Instructions Section 3-6
Description CMPL(060) compares the unsigned binary data in S
1
+1, S
1
and S
2
+1, S
2
and outputs the result to Arithmetic Flags (the Greater Than, Greater Than or
Equal, Equal, Less Than or Equal, Less Than, and Not Equal Flags) in the
Auxiliary Area.
Arithmetic Flag Status
The following table shows the status of the Arithmetic Flags after execution of
CMPL(060). (A status of “---” indicates that the Flag may be ON or OFF.)
Using CMPL(060) Results in the Program
When CMPL(060) is executed, the result is reflected in the Arithmetic Flags.
Control the desired output or right-hand instruction with a branch from the
same input condition that controls CMPL(060), as shown in the following dia-
gram. Here, the Equals Flag and output A will be turned ON when S
1
+1, S
1
=
S
2
+1, S
2
.
Indirect DM addresses in
binary
@ D0 to @ D32767
Indirect DM addresses in
BCD
*D0 to *D32767
Constants #00000000 to #FFFFFFFF (binary)
&0 to &4294967295 (unsigned decimal)
Data Registers ---
Index Registers IR0 to IR15
Indirect addressing using
Index Registers
,IR0 to ,IR15
–2048 to +2047 ,IR0 to –2048 to +2047 ,IR15
DR0 to DR15, IR0 to IR15
,IR0+(++) to ,IR15+(++)
,–(– –)IR0 to, –(– –)IR15
Area S
1
S
2
CMPL(060)Result Flag status
>> ==< =<< >
S
1
+1, S
1
> S
2
+1, S
2
ON ON OFF OFF OFF ON
S
1
+1, S
1
= S
2
+1, S
2
OFFONONONOFFOFF
S
1
+1, S
1
< S
2
+1, S
2
OFF OFF OFF ON ON ON
(>, >=, =, <=, <, <>)
S2+1
Unsigned binary
comparison
Arithmetic Flags
CMPL
S1
S2
A
Correct Use of CMPL(060)
Arithmetic Flag
(Example: Equal Flag)

Table of Contents

Related product manuals