Omron SYSMAC CJ - REFERENCE MANUAL 01-2008 Reference Manual page 353

Sysmac cs/cj/one nsj series programmable controllers
Table of Contents

Advertisement

Comparison Instructions
Description
314
CPSL(115) compares the double signed binary data in S
S
and outputs the result to Arithmetic Flags (the Greater Than, Greater Than
2
or Equal, Equal, Less Than or Equal, Less Than, and Not Equal Flags) in the
Auxiliary Area.
Note CPSL(115) treats the data in S
ranges from 8000 0000 to 7FFF FFFF (
imal).
Arithmetic Flag Status
The following table shows the status of the Arithmetic Flags after execution of
CPSL(115). (A status of "---" indicates that the Flag may be ON or OFF.)
CPSL(115)Result
S
+1, S
> S
+1, S
1
1
2
S
+1, S
= S
+1, S
1
1
2
S
+1, S
< S
+1, S
1
1
2
Using CPSL(115) Results in the Program
When CPSL(115) 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 CPSL(115), 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
Using CPSL(115) Results in the Program
Do not program another instruction between CPSL(115) 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 CPSL(115).
Signed binary
comparison
Arithmetic Flags
(>, >=, =, <=, <, <>)
and S
as double signed binary data which
1
2
2,147,483,648 to 2,147,483,647 dec-
>
> =
ON
ON
OFF
2
OFF
ON
ON
2
OFF
OFF
OFF
2
Correct Use of CPSL(115)
Arithmetic Flag
(Example: Equal Flag)
Section 3-7
+1, S
and S
1
1
S2+1
Flag status
=
< =
<
OFF
OFF
ON
OFF
ON
ON
1
CPSL
S1
S2
A
+1,
2
< >
ON
OFF
ON
+1, S
=
1

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents