249
Cycle Time/High-speed Processing Section 6-1
Programming Example 1
■ Traditional Programming without Background Execution
As shown below, processing is completed when the instruction is executed.
■ Programming with Background Execution
With background execution, the program is changed so that MAX(182) is exe-
cuted only when the specified Communications Port Enabled Flag is ON (i.e.,
only when the port is not already being used for background execution or net-
work communications). Also, input conditions are controlled with SET and
RESET instructions to ensure that processing is performed in the correct
order. (Communications port 0 is used for background execution in the follow-
ing example.)
MAX
D00000
D00100
D00200
a
SUM
D00002
D00100
D00201
Execution condition
MAX(182) is executed completely as soon
as the execution condition “a” turns ON.
SUM(184) can be executed immediately
after MAX(182).
RSET
a
SET
b
MAX
D00000
D00100
D00200
a A20200
RSET
b
SUM
D0000
2
D00100
D00201
b A20200
SET
c
c
A20200
Execution
condition
Execution condition “b” is turned ON to
enable the next background instructions
(here, SUM(184)).
SUM(184) execution is started if
execution condition “b” is ON and the
Communications Port Enabled Flag is ON
(i.e., when MAX(182) execution has been
completed).
MAX(182) execution is started if execution
condition “a” is ON and the Communications
Port Enabled Flag is ON.
“a” is turned OFF so that MAX(182) will not
be executed the next cycle.
“b” is turned OFF so that SUM(184) will not
be executed the next cycle.
Execution of SUM(184) has been completed
when “c” is ON and the Communications
Port Enabled Flag is ON.
“c” is turned ON to enable confirming the
completion of SUM(184).
Confirmation of
completion of
background
execution
Communications
Port Enabled Flag
Execution
condition
Communications
Port Enabled Flag