Chapter 10 CPU Function
Chapter 10 CPU Function
10.1 Task Design
10.1.1 Task Overview
There are 3 types of motion control tasks: main task, periodic task and initialization task.
Motions
Main task
Up to 256
• It performs I/O refresh, processing of programs assigned to main task and motion
control.
• It performs the above tasks at a time for each of the established control period
(main task cycle).
• It has higher priority than periodic task.
• It uses programs that require synchronized control and high-speed operation
processing through allocation since it is possible to process program fast.
• Period possible to be set: 1ms, 2ms, 4ms
Periodic
task
• It performs processing of programs assigned to main task.
• It is performed for the remaining time after implementation of main task operation
within the control period, and can be performed over multiple cycles.
• Since it has lower priority than main task in the execution of motion control
commands within main task program, the motion control commands executed in the
main task program are processed first.
• It uses programs of processing other monitoring data and control of device that
doesn’t require high-speed processing through allocation.
• Period possible to be set: 1ms ~ 100ms (Set to a multiple of the main task cycle)
Initialization
task
• It performs processing of programs assigned to the initialization task after
implementing I/O refresh.
• It is performed only once at the time of entering the RUN mode.
• It is executed first when entering RUN mode. If the initial task completion
(_INIT_DONE) flag is set by the initialization task program, the task is completed,
and the execution of the main task and periodic task program starts.
(1) Main task and periodic task
Both the main task and the periodic task are executed at fixed intervals. The interval at which the main task
and periodic task are executed is called the ‘task cycle’. The main task can be set in cycles of 500㎲, 1㎳, 2㎳
and 4㎳, and the periodic task can be set in multiple of the main task cycle. However, the periodic task cycle
can be set in ㎳ unit.
In the task, 1 to 256 programs can be used. The programs are executed in the order in which they are
assigned.
I/O refresh refers to the exchange of data between the digital I/O module and the analog module. The I/O
refresh is performed at the beginning of the main task execution per cycle.