Omron SYSMAC CJ - REFERENCE MANUAL 08-2008 Reference Manual page 347

Programmable controllers
Hide thumbs Also See for SYSMAC CJ - REFERENCE MANUAL 08-2008:
Table of Contents

Advertisement

Comparison Instructions
Description
CMPL(060) compares the unsigned binary data in S
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.)
CMPL(060)Result
S
+1, S
> S
+1, S
ON
1
1
2
2
S
+1, S
= S
+1, S
OFF
1
1
2
2
S
+1, S
< S
+1, S
OFF
1
1
2
2
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
S
+1, S
.
2
2
Correct Use of CMPL(060)
Using CMPL(060) Results in the Program
Do not program another instruction between CMPL(060) and the instruction
controlled by the Arithmetic Flag because the other instruction might change
the status of the Arithmetic Flag. In this case, the results of instruction B might
change the results of CMPL(060).
Unsigned binary
comparison
S2+1
Arithmetic Flags
(>, >=, =, <=, <, <>)
Flag status
>
> =
=
ON
OFF
ON
ON
OFF
OFF
Arithmetic Flag
(Example: Equal Flag)
Section 3-7
+1, S
and S
+1, S
1
1
2
< =
<
< >
OFF
OFF
ON
ON
OFF
OFF
ON
ON
ON
+1, S
1
CMPL
S1
S2
A
307
2
=
1

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cs seriesSysmac one nsj seriesSysmac cj series

Table of Contents