A freewheeling task is executed cyclically but without a fixed task cycle. This is a recurring task in the classic sense of the PLC.
Execution takes place as often as possible. However, processing does not take place in a fixed cycle. You cannot define a task cycle time for this kind of task. The time behavior is selected automatically and done in such a way that as little load as possible is placed on the overall system.
Moreover, a specific amount of time is waited after the end of a run until the task is executed again. The duration is a percentage of the last cycle duration.
|
Important |
|---|---|
|
No fixed task cycle time and no fixed time behavior is guaranteed for the freewheeling task. |
You can configure a watchdog for a freewheeling task.
The load of all freewheeling IEC tasks is determined by the runtime system so that this load does not exceed half of the set maximum processor load.
MaxCpuLoadFreewheeling = ((MIN( 100, MaxProcessorload) / 2) / NumOfFreeWheelingTasks); SleeptimeAfterCycle = CycleTimeFreewheelingTask * ((100 - MaxCpuLoadFreewheeling) / 100) if (SleeptimeAfterCycle < 1000) // Minimum sleeptime of 1ms is mandatory! SleeptimeAfterCycle = 1000;
Example 26. Example
The runtime system of an application runs as follows:
-
MaxProcessorload= 80 -
CycleTime= 20 ms -
1 freewheeling task
Effect
-
MaxCpuLoadFreewheeling= 40 % -
SleeptimeAfterCycle= 30 ms -
Total cycle time of the freewheeling task = 50 ms
⇒ A total CPU load of 60% is achieved for the rest of the system.