Chapter 10 CPU Function
(2) Task partitioning
All programs should be assigned to one task. Users are required to assign the task according to the
characteristics of the created program by referring to the table below.
Main task
• The execution cycle of I/O refresh should be strictly observed.
• Highest execution priority
• High-priority motion control is included.
Periodic task
• Program that can be operated regardless of I/O refresh
• Program that has lower execution priority than the main task and requires
Initialization task
• Execution is required prior to the main task program execution during the
RUN operation
•Device initialization and initial value setting program
10.1.2 Task Specification
The specifications of the tasks are as follows.
Types of tasks
• Periodic task
㎲
㎳
㎳
㎳
• Can be set to a multiple of the main task from 1 to 100
㎳
Initialization task cycle
• Same as the main task cycle
Periodic task cycle that can be set depending on the main task cycle
Periodic task cycle that can be set
㎲
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
㎳
10.1.3 Basic Operation of Task
Several tasks of XMC-E32A cannot be executed at the same time. Each task is executed according to its
priority, and the main task program has higher priority than the periodic task program.
If the main task program execution cycle is reached during the execution of the periodic task program, the main
task program is executed. Therefore, while the main task program is executed in accordance with the cycle, the
periodic task program can be executed in several main task cycles. If you use the periodic task program, you
should write the program by referring to this point.
In addition, the cycle should be set so that the task program execution can be completed within the set period.
If the task exceeds the set period, a warning is issued. If the task execution is not completed until the periodic
error detection time, the system switches to the ERROR state.