Omron CJ - REFERENCE MANUAL 02-2010 Reference Manual page 300

Table of Contents

Advertisement

3. Instructions
Precautions
• When CPS(114)/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
CPS(114)/CPSL(115), as shown in the following diagram.
• Do not program another instruction between CPS(114)/CPSL(115) and the instruction controlled by
the Arithmetic Flag because the other instruction might change the status of the Arithmetic Flag.
• The immediate-refreshing variation (!CPS(114)/!CPSL(115)) can be used with words allocated to
external inputs specified in S
will be performed for the external input word specified in S
compared. (Immediate refreshing cannot be performed on inputs allocated to Group-2 High-density
I/O Units or Units mounted to Slave Racks.)
Example Programming
When CIO 0.00 is ON in the following example, the eight-digit signed binary data in D2 and D1 is
compared to the eight-digit signed binary data in D6 and D5 and the result is output to the Arithmetic
Flags.
• If the content of D2 and D1 is greater than that of D6 and D5, the Greater Than Flag will be turned
ON, causing CIO 20.00 to be turned ON.
• If the content of D2 and D1 is equal to that of D6 and D5, the Equals Flag will be turned ON, causing
CIO 20.01 to be turned ON.
• If the content of D2 and D1 is less than that of D6 and D5, the Less Than Flag will be turned ON,
causing CIO 20.02 to be turned ON.
0.00
264
CPS/CPSL
Arithmetic Flag
(Example: Equal Flag)
In this case, the Equals Flag and output A will be turned
ON when S
= S
1
Arithmetic Flag
(Example: Equal Flag)
In this case, the results of instruction B might
change the results of CPS(114)/CPSL(115).
and/or S
. When !CPS(114)/!CPSL(115) is executed, input refreshing
1
2
i
CPSL
D1
D5
20.00
>
20.01
=
20.02
<
S1
S2
A
or S
+1, S
= S
+1, S
.
2
1
1
2
2
CPS/CPSL
S1
S2
Instruction B
A
and/or S
and that refreshed value will be
1
2
D2
D1
1234
5678
Comparison
D6
D5
ABCD
EF12
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Flag status
>
ON (1)
=
OFF (0)
Result
<
OFF (0)

Advertisement

Table of Contents
loading

Table of Contents