Chapter 7 Program
Chapter 7 Program
7.1 Program Configuration
The program of the motion controller is divided into main task program, periodic task program and initialization task program. The
features of each program in execution are as follows.
7.1.1 Program Configuration
The motion controller's initialization, main and periodic task programs are executed based on the cycle. Each task has a fixed cycle and
is set by the user in the default parameters. There are two configurable cycles: main task cycle and periodic task cycle. The initialization
task adopts the cycle of the main task.
Initialization task program
• The initialization task program is the first task program executed after the motion controller
completes its own initialization required for operation when power is applied. It runs until the
INIT_DONE command is executed.
• When the initialization program is executed, only the initialization program is executed and
the main task program and the periodic task program do not run until the INIT_DONE
command is executed.
• Even while the initialization task program runs, I / O Refresh and other functions are executed
normally.
•
The initialization task program is used to program various operations required for initial setting
of the motion controller.
Main task program
• This program is executed at intervals of the main task’s cycle set in the motion controller.
• The main task’s cycle can be set in the "Main Task Cycle" of the basic parameters, and you
can select one among 500 μs, 1 ms, 2 ms, or 4 ms.
•
When the run time of the main task program exceeds the set main task cycle, the cycle
warning occurs. If the main task program is not completed during detecting the cycle error,
Periodic task program
• The program is executed every periodic task cycle set in the motion controller.
• The periodic task cycle can be set in the "Periodic Task Cycle" of the basic parameters and
must be set to a multiple of the configured main task cycle.
• The periodic task program runs in the spare time after the motion controller executes the
main task program every main task cycle and then, it runs repeatedly every periodic task
For more details on the execution of the main task program and periodic task program, refer to "4.3 Motion control task".