10 CPU Unit Functions
10-18
CJ2 CPU Unit Software User’s Manual
This example shows background execution when referencing Condition Flags.
z Programming without Background Execution
To check whether the minimum value found by MIN(183) is 0, the status of the Equals Flag is
checked just after execution of MIN(183).
z Programming with Background Execution
As shown in the following figure, an AND =(300) instruction is used to check whether the minimum
value found by MIN(183) is 0.
Programming Example 3
MIN
D1000
D2000
D0
a
P_EQ
W0.00
MIN(183) is executed when
execution condition "a" goes
ON and the minimum value is
stored in D0.
When the minimum value in
D0 is 0, the Equals Flag goes
ON and W0.00 is turned ON.
Execution condition
EQ Flag
MIN
D1000
D2000
D0
a
SET
b
W0.00
D0
&0
A202.00
b
RSET
b
Execution condition
Execution condition
EQ Flag
MIN(183) is executed when
execution condition "a" goes ON
and the minimum value is
stored in D0.
At the same time, execution
condition "b" is turned ON.
When D0 contains 0000 hex,
W0.00 is turned ON.
After the comparison, execution
condition "b" is reset to OFF.