BackgroundTask (FB)¶
FUNCTION_BLOCK FINAL BackgroundTask EXTENDS FBF.InstanceBase IMPLEMENTS IBackgroundTask, ICmpEventCallback
Encapsulates all the details of managing a iec task in the context of the runtime system.
A running background task can be controlled via the methods of IBackgroundTask.
Note
- Watchdog Sensitivity:
If the actual cycle time of a task exceeds the currently
udiWatchdogTime, the currently definedusiWatchdogSensitivityvalue is taken into account:Sensitivity 0, 1 => exception in cycle 1
Sensitivity 2 => exception in cycle 2
Sensitivity n => exception in cycle n
Single Timeout => Exception if the actual cycle time is longer than
usiWatchdogSensitivityxudiWatchdogTime.
- InOut:
Scope
Name
Type
Comment
Input Const
tgTaskGroupanAppNametnTaskNameusiTaskPrioUSINTudiTaskIntervalUDINTTaskinterval in µs
xWatchdogEnabledBOOLTRUE=> Watchdog will be enabledudiWatchdogTimeUDINTWatchdog Time in µs
usiWatchdogSensitivityUSINTDefines the behavior of a task watchdog when exceeding the
udiWatchdogTime. (See note above)Input
xEnableBOOLTRUE: Activates the defined operationFALSE: Aborts/resets the defined operationitfParamsSHD.ISharedQueueParameter Queue feeding the IAsyncActionProvider.AsyncAction
itfActionSpecifies the action executed in the context of this background task
Output
xBusyBOOLTRUE: Operation is runningxErrorBOOLTRUE: Error condition reachedeErrorIDIf
xErrorisTRUE=> Information about the current error conditionitfResultSHD.ISharedAreaCurrent states and results of the background task
dwCurrentCycleTimeDWORDdwAverageCycleTimeDWORDdwMaxCycleTimeDWORDdwMinCycleTimeDWORDdwCycleCounterDWORD
Properties:
Methods:
Structure: