Omron SYSMAC CP Series Instruction & Reference Manual page 136

Cpu unit
Hide thumbs Also See for SYSMAC CP Series:
Table of Contents

Advertisement

2 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
CPU Unit built-in inputs specified in S
refreshing will be performed for the external input word specified in S
value will be compared.
Sample program
When CIO 0.00 is ON in the following example, the eight-digit signed binary data in D2 and D1 is com-
pared 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
2-100
CPS/CPSL
S1
S2
A
Arithmetic Flag
(Example: Equal Flag)
In this case, the Equals Flag and output A will be turned
ON when S
= S
or S
+1, S
1
2
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
1
2
i
CPSL
D1
D5
20.00
>
20.01
=
20.02
<
= S
+1, S
.
1
2
2
CPS/CPSL
S1
S2
Instruction B
A
and/or S
1
D2
D1
1234
5678
Comparison
Result
D6
D5
ABCD
EF12
CP1E CPU Unit Instructions Reference Manual(W483)
and that refreshed
2
Flag status
>
ON (1)
=
OFF (0)
<
OFF (0)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents