BackgroundTask (FB)

FUNCTION_BLOCK FINAL BackgroundTask EXTENDS CBML.LConC 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 defined usiWatchdogSensitivity 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 x udiWatchdogTime.

InOut:

Scope

Name

Type

Comment

Inherited from

Input

xEnable

BOOL

TRUE: Activates the defined operation FALSE: Aborts/resets the defined operation

LConC

Output

xBusy

BOOL

TRUE: Operation is running

LConC

xError

BOOL

TRUE: Error condition reached

LConC

Input Const

tgTaskGroup

TASK_GROUP

anAppName

APP_NAME

tnTaskName

TASK_NAME

usiTaskPrio

USINT

udiTaskInterval

UDINT

Taskinterval in µs

xWatchdogEnabled

BOOL

TRUE => Watchdog will be enabled

udiWatchdogTime

UDINT

Watchdog Time in µs

usiWatchdogSensitivity

USINT

Defines the behavior of a task watchdog when exceeding the udiWatchdogTime. (See note above)

Input

itfParams

SHD.ISharedQueue

Parameter Queue feeding the IAsyncActionProvider.AsyncAction

itfAction

IAsyncActionProvider

Specifies the action executed in the context of this background task

Output

eErrorID

ERROR

If xError is TRUE => Information about the current error condition

itfResult

SHD.ISharedArea

Current states and results of the background task

dwCurrentCycleTime

DWORD

dwAverageCycleTime

DWORD

dwMaxCycleTime

DWORD

dwMinCycleTime

DWORD

dwCycleCounter

DWORD

Methods:

Structure: