Systemsoftware
System- and communication configuring D7-SYS - SIMADYN D
2-37
Edition 03.2001
The task administrator ensures that the functions, assigned to the various
tasks are cyclically processed. The cyclic tasks are in a ratio to the power
of 2 to each other
T(i) = T(0) * ( 2 ** j) with T(0) as basic sampling time,
j defines the sampling time value with 0 <= j <= 15
i numbers the sampling times with 1 <= i <= 5.
For a basic sampling time of 1 ms, the sampling times can be 1 ms, 2 ms,
8 ms, 32 ms and 128 ms. The basic sampling time is defined for each
CPU module during configuring, using the HWConfig program section of
the SIMATIC Manager. The sampling times of the tasks running on the
particular CPU module are also configured at this time.
In order to prevent bottlenecks, the tasks are started, phase-shifted with
the basic clock cycle, so that with the basic clock cycle, the start of a
second, lower-priority task is flagged. As result of the discrete distribution
of the sampling times, based on a ratio to the power of 2, also low-priority
tasks are completely taken into account. This means that it no longer
occurs as a low-priority sampling time on the basic clock cycle. (refer to
the Chapter "Processor utilization"). The priorities of the various tasks
decreases with increasing sampling time.
The task administrator is started with the clock cycle of the basic
sampling time of the sampling time timer. This determines the second
task, task Tn to be started in addition to T1 (Tn from {T2...T5}). If the task
to be started has a lower priority than an interrupted task, its start is
buffered, and the interrupted task is continued. Otherwise, the
determined task is started. The status of the interrupted task is written
into a task-specific data area, which allows the task to be further
processed as soon as a higher-priority task is no longer present (refer to
Fig. Calculating the run time ).
The time component required by the operating system itself is not taken
into account in this description. If the diagram was to be precise, then the
actual starting instant of the task would be shifted by these amounts.
In addition to cyclic processing, the operating system also administers
tasks, which are started by non-cyclic interrupts, especially process
interrupts. Interrupt sources could be:
•
software
interrupts
•
CPU-timer
interrupts
•
L/C-bus
interrupts
•
LE-bus
interrupts
The priority of the interrupt tasks is defined by the data configured in
HWConfig (I1 > I2...> I8). The programming engineer programming the
user program configures, using HWConfig, the interrupt sources which he
or she requires for his or her application, and their processing in the
interrupt-controlled tasks.
Cyclic processing
(RUN operating
status)
Example:
Interrupt-controlled
processing