Chapter 10 CPU Function
I/O
refresh
Program
Motion
control
Program
I/O
refresh
Program
Motion
control
Program
Main task period Main task period
Periodic task period
Perform
main task
Perform
periodic task
WaitingWaiting
Performance time of periodic task
In the main task execution, the double line display after the program execution the motion control or
periodic task execution indicates that the task execution is completed.
(1) Cycle of main task and periodic task
The main task and periodic task are the ones that are executed repeatedly in cycles. Both tasks have a task
execution cycle, and the periodic task cycle can be set to a multiple of the main task cycle.
For example, if the main task cycle is 1㎳, and the periodic task cycle is 2㎳, the periodic task is executed
every time the main task is executed twice.
I/O
refresh
Progra
m
Motion
control
Program
Prog
ram
Main task period Main task period
Periodic task period
Perform
main task
Perform
periodic tas k
Waiting Waiting
Program
Prog
ram
Main task period Main task period
Periodic task period
Waiting Waiting
I/O
refresh
Progra
m
Motion
control
I/O
refresh
Progra
m
Motion
control
I/O
refresh
Progra
m
Motion
control
(2) Initialization task
The initialization task is executed until the initialization task execution completion (_INIT_DONE) flag is set
before the execution of the main task, and it is terminated when the user sets the _INIT_DONE flag in the
program. Only when the initialization task is terminated, the main task and periodic task programs are
executed. The initialization task cycle inherits the main task cycle.
Notice
If the initialization task execution completion (_INIT_DONE) flag is set by the user-written initialization task
program, the execution of the initialization task program is terminated, and the execution of the main task and
periodic task programs are started.
The initialization task operates in the main task cycle and is included in the main task execution time.