Chapter 5 Program Configuration and Operation Method
5
-
11
7)
Verification of Task Program
Verify the following contents after writing the Task Program.
(1) Is the task setting proper ?
If task occurs frequently more than needed or several tasks occur in one scan at the same time, scan
time may lengthen or be irregular. In case not possible to change the task setting, verify max. scan
time.
(2) Is the priority of task arranged well?
The low priority task program shall be delayed by the high priority task program, which results in
disabling the processing within the correct time and even task collision may occur as next task
occurs in the state that the execution of previous task is delayed. Consider the emergency of task
and execution time etc when setting the priority.
(3) Is the Task Program written in shortest?
If the execution time of Task Program is longer, scan time may lengthen or be irregular. Even it may
cause the collision of task program. Write the execution time as short as possible. (Especially,
when writing the cyclic task program, write the execution time so that the task program can be
executed within 10% cycle of the shortest task among several tasks.)
(4) Is program protection for the high priority task needed during program execution?
If other task is inserted during task program execution, complete the task in execution and operate the
standby tasks in the order of high priority. In case that it is not allowed to insert other task in Scan
Program, prevent the insert partially by using ‘DI’ and ‘EI’ application instruction. The problem may
occur while processing the global variables used commonly with other program or special or
communication module.
8) Program Configuration and Processing Example
If task and program are registered as below,
•
Task registration :
T_SLOW ( cycle time : = 10ms, Priority:= 3 )
PROC_1 ( internal device: = M0, Priority := 5 )
•
Program registration : Program --> P0
Program --> P0 (scan program)
Program --> P1 (start by task T_SLOW)
Program --> P2 (start by task PROC_1)
And program execution time and the occurrence time of interrupt signal is same as follows,
•
Execution time of each Program : P0 = 17ms, P1 = 2ms, P2 = 7ms
•
PROC_1 occur: The execution of program occurred during Scan Program is as below.