IF_AsyncManager - Init (Method)

Overview

Type:

Method

Available as of:

 

Versions:

Current version

Task

Initializes the Async mechanism and generates the asynchronous tasks

Description

It checks if Gc_udiNumOfAsyncTasks is <> 0 and if an initialization has not been executed yet. Then asynchronous tasks are created depending on the value of Gc_udiNumOfAsyncTasks.

For asynchronous tasks the following conditions apply:

oAsynchronous tasks run with the priority 31.

oTime critical tasks must not be stored in asynchronous tasks.

(To optimize the program it makes sense to relieve time critical tasks.)

NOTE: The Init method must be executed in a separate part of the program (Init step), before the time critical part of the program is processed. By every call of Init a new task is created as long as the number of created tasks is < Gc_udiNumOfAsyncTasks. Creating a new task takes about 0.8 ms. The more tasks that are used the more often the Init method has to be called till q_xDone is signaled . Only create necessary tasks. If possible, only use one single task. Store Init in a separate, time-uncritical part of the program.

The Init() method has to be called up until it reports q_xDone=TRUE. Depending on the Gc_udiNumOfAsyncTasks, the time of the successful execution is differential. The value of q_xDone must be checked to detect that a asynchronous task was executed correctly (see also Start).

The jobs can only be transferred to the AsyncManager after the successful call-up.

NOTE: For a diagnostic of Init it is possible to evaluate in the message logger if a cycle time overrun occurs because of the call up of Init. Please note that no filter is set which avoids the indication of the messages.

Interface

Output

Data type

Description

q_xBusy

BOOL

TRUE: The POU is currently being executed.

FALSE: The POU is currently not being executed.

q_xDone

BOOL

TRUE: The POU has been executed.

FALSE: The POU has not been executed yet.

q_etDiag

GD.ET_Diag

General library-independent statement on the diagnostic.

A value unequal to ET_Diag.Ok corresponds to a diagnostic message.

q_etDiagExt

ET_DiagExt

POU-specific output on the diagnostic.

q_etDiag = ET_Diag.Ok -> Status message

q_etDiag <> ET_Diag.Ok -> Diagnostic message

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

CreatingAsyncTaskNames

293

Generate name for the asynchronous tasks.

OK

CreatingAsyncTasks

294

Generate asynchronous tasks.

OK

InitAlreadySuccessfullyCalled

292

Init has already been called up successfully.

OK

WaitUntilAsyncTasksCreated

296

Wait until asynchronous tasks have been generated.

InputParameterInvalid

NumOfAsyncTasksRange

291

Invalid value of Gc_udiNumOfAsyncTasks. Gc_udiNumOfAsyncTasks must be <> 0.

UnexpectedProgramBehavior

CreatingAsyncTasksFailed

295

Generating the asynchronous task failed.

CreatingAsyncTaskNames

Enumeration name:

CreatingAsyncTaskNames

Enumeration value:

293

Description:

Generate name for the asynchronous tasks.

Depending on the number of asynchronous tasks, different task names are generated respectively.

CreatingAsyncTasks

Enumeration name:

CreatingAsyncTasks

Enumeration value:

294

Description:

Generate asynchronous tasks.

Between one and a maximum of ten tasks are generated.

CreatingAsyncTasksFailed

Enumeration name:

CreatingAsyncTasksFailed

Enumeration value:

295

Description:

Generating the asynchronous task failed.

Issue

Cause

Solution

-

An error has been detected and occurred in the internal execution.

Please inform the support team about this detected error.

InitAlreadySuccessfullyCalled

Enumeration name:

InitAlreadySuccessfullyCalled

Enumeration value:

292

Description:

Init has already been called up successfully.

Issue

Cause

Solution

-

Method Init() of IF_AsyncManager has already been executed successfully.

To perform another initialization, the controller must be restarted.

NumOfAsyncTasksRange

Enumeration name:

NumOfAsyncTasksRange

Enumeration value:

291

Description:

Invalid value of Gc_udiNumOfAsyncTasks. Gc_udiNumOfAsyncTasks must be <> 0.

Issue

Cause

Solution

-

Gc_udiNumOfAsyncTasks still has the default value = 0

Allocate Gc_udiNumOfAsyncTasks with a value > 0 and <= 10.

WaitUntilAsyncTasksCreated

Enumeration name:

WaitUntilAsyncTasksCreated

Enumeration value:

296

Description:

Wait until asynchronous tasks have been generated.

It is waited until all asynchronous tasks have been generated.