By configuring sufficiently large task cycle times, the CPU in your M580 Hot Standby system can process the data produced by the system in a single scan. If the configured task cycle time is smaller than the required processing time, the CPU will force the task to over-run.
There are two main conditions to be satisfied, to avoid over-run events. By using the formulas (set forth below) to compute the minimum task time periods for your system, you can avoid a task over-run situation.
Condition 1: the I/O Configuration
The general formula for a multi task application is:
(# of RIO drops using MAST task/MAST cycle time) +
(# of RIO drops using SAFE task/SAFE cycle time) +
(# of RIO drops using FAST task/FAST cycle time) < 1.5
Where all cycle times are measured in ms.
NOTE: M580 Hot Standby CPUs support only the MAST, FAST and SAFE tasks. AUX0 and AUX1 are not supported.
Distributed Equipment:
If DIO devices are configured, increase the minimum cycle time.
Example:
In this example, the configuration consists of:
The minimum MAST cycle time equals:
10 / TMAST < 1.5
or
TMAST > 6.7 ms
Condition 2: The PAC Processor Load
Each application task uses a percentage of the processor resources, referred to here as the task bandwidth (TaskBW). The bandwidth for user-configured tasks depends on:
-
The user code executed at each cycle.
-
The task itself.
-
The size of the data associated with the task.
-
The configured task period.
The PAC manages a set of user and system tasks and schedules them using a fixed priority strategy. It is necessary to reserve a minimum of spare processor bandwidth to permit the PAC to behave as expected and to be able to handle other seldom-performed intermittent operations, for example, online modifications. This condition is described by the expression:
MastBW + SafeBW + FastBW < 0.8
Task Bandwidth Evaluation:
The task bandwidth evaluation (TaskBW) is the ratio of the CPU resources that are used by a task per time unit. To be evaluated, it is necessary to know or evaluate the following elementary information:
-
The task execution time (TEXE) of each task on the target. It can be measured with Control Expert under the following conditions:
-
The PAC is not connected to a standby PAC. (See Note 1, below.)
-
The task periods are tuned to their highest possible setting to limit the task interference.
TEXE = minimum execution time. (See Note 2, below.)
-
The task period (TPER), which is a user-configured setting. It is recommended to use the configured task period, and do not adjust the value in the application program, because some communication time-outs can be automatically set by the Control Expert configuration software, based upon the configured task period values.
TPER = the period planned to be used during normal operation.
-
For a Hot Standby PAC, the time needed to transfer (TTFR) the data with the remote PAC, for each task, needs to be added. This is given as:
-
For the MAST and FAST tasks:
TTFR = (K1 x TaskKB + K2 x TaskDFB) / 1000
-
For the SAFE task:
TTFR = (K1 x TaskKB + K2 x TaskDFB) / 500
In each case, TTFR is measured in milliseconds.
In the preceding formulas, K1 and K2 are constants, with values determined by the specific CPU module used in the application:
Coefficient
|
BMEH582040S
|
BMEH584040S or BMEH586040S
|
K1
|
32.0
|
10.0
|
K2
|
23.6
|
7.4
|
The task bandwidth is described using the following formula:
TaskBW = (TEXE + TTFR) / TPER
NOTE:
-
If the PAC is connected to the standby, then the execution time provided by Control Expert includes the transfer time and is equal to T
EXE + T
TFR. Nevertheless, the measure may be more unstable, and may be affected by the lack of task synchronization. (Check the MAST, FAST, and SAFE synchronization bits in the
T_M_ECPU_HSBY DDT).
-
Some applications have a very unstable execution time because the code executed is slightly different from one task cycle to the next. There is no general rule to decide which value for minimum task bandwidth should be considered in this case.