BackgroundTask
(FB)
FUNCTION_BLOCK FINAL BackgroundTask EXTENDS FBF.InstanceBase IMPLEMENTS IBackgroundTask
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 definedusiWatchdogSensitivity
value 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
usiWatchdogSensitivity
xudiWatchdogTime
.
- InOut:
Scope
Name
Type
Comment
Input
tgTaskGroup
anAppName
tnTaskName
usiTaskPrio
USINT
udiTaskInterval
UDINT
Taskinterval in µs
xWatchdogEnabled
BOOL
TRUE
=> Watchdog will be enabledudiWatchdogTime
UDINT
Watchdog Time in µs
usiWatchdogSensitivity
USINT
Defines the behavior of a task watchdog when exceeding the
udiWatchdogTime
. (See note above)xEnable
BOOL
TRUE
: Activates the defined operationFALSE
: Aborts/resets the defined operationitfParams
SHD.ISharedQueue
Parameter Queue feeding the IAsyncActionProvider.AsyncAction
itfAction
Specifies the action executed in the context of this background task
Output
xBusy
BOOL
TRUE
: Operation is runningxError
BOOL
TRUE
: Error condition reachedeErrorID
If
xError
isTRUE
=> Information about the current error conditionitfResult
SHD.ISharedArea
Current states and results of the background task
dwCurrentCycleTime
DWORD
dwAverageCycleTime
DWORD
dwMaxCycleTime
DWORD
dwMinCycleTime
DWORD
dwCycleCounter
DWORD
IBackgroundTask
IBehaviourModel
BackgroundTask.AbortModel
(METH)BackgroundTask.ActionController
(PROP)BackgroundTask.GetConfiguration
(METH)BackgroundTask.GetConfiguration2
(METH)BackgroundTask.GetModelState
(METH)BackgroundTask.ModelTimeLimit
(PROP)BackgroundTask.ModelTimeOut
(PROP)BackgroundTask.ResetModel
(METH)BackgroundTask.StartModel
(METH)