
6 User Program
System Manual Compact Systems
Page 32 of 110
HI 800 141 E Rev. 2.02
reason, the reaction to this input change is only available at the end of CPU cycle
.
The reaction time of
Prg 2
is two times longer than that of
Prg 1
.
Upon completion of the first part
of the
Prg 2
cycle under consideration,
Prg 2
processing is
completely aborted and only resumed when
starts. During its cycle,
Prg 2
processes the
data provided by the system during
. The results of
Prg 2
are available to the system during
(e.g., for process output). The data that the system exchanges with the user program are
always consistent.
The program execution order can be controlled by assigning a priority, which indicates how
important the corresponding user program is compared to the others (see multitasking mode 2).
To specify the user program execution order, use the following parameters in the resources and
programs or in the Multitasking Editor:
i
A license is required to use the multitasking feature.
Parameter
Description
Configurable for
Watchdog
Time
Resource Watchdog Time
Resource, Multitasking
Editor
Target Cycle
Time [ms]
Required or maximum cycle time
Resource, Multitasking
Editor
Multitasking
Mode
Use of the execution duration unneeded by the user
program, e. g., the difference between actual
execution duration in one CPU cycle and the defined
Max. Duration for Each Cycle [µs]
.
Resource, Multitasking
Editor
Mode 1 The duration of a CPU cycle is based on
the required execution time of all user
programs.
Mode 2 The processor provides user programs
with a higher priority the execution time not
needed by user programs with a lower
priority. Operation mode for high
availability.
Mode 3 During the execution time not needed by
the user programs, the processor waits for
the time to expire, thus increasing the
cycle.
Target Cycle
Time Mode
Use of
Target Cycle Time [ms].
Resource, Multitasking
Editor
Program ID
ID for identifying the program when displayed in
SILworX
User Program
Priority
Importance of a user program; highest priority: 0.
User Program
Program's
Maximum
Number of
CPU Cycles
Maximum number of CPU cycles required to process
one user program cycle.
User Program
Max. Duration
for Each Cycle
[µs]
Time permitted for executing the user program within
a CPU cycle.
User Program
Table 21: Parameters Configurable for Multitasking
Observe the following rules when setting the parameters:
If
Max. Duration for Each Cycle [µs]
is set to 0, the execution time of the user program is not
limited, e.g., it is always processed completely. Therefore, the number of cycles may be set
to 1 in this case.