This operator is an extension of the IEC 61131-3 standard.
In runtime mode, the operator provides information about the IEC task that is currently running.
The operator is supported only on target systems in which the target system setting
memory-layout\max-stack-size
is set to a value > 0.
The operator allows for access to a structure with two variables:
-
TaskIndex
: Zero-based index that identifies the task -
pTaskInfo
: Detailed information about the currently running task. It can be assigned to aPOINTER TO Task_Info2
from the libraryCmpIecTask
.
The operator cannot be used in the declaration of a POU. This would result in an error
message. If the current task cannot be determined, then the TaskIndex -1
and the pTaskInfo
are zero.
Example
//Declaration VAR idx : INT; pInfo : POINTER TO Task_Info2; END_VAR //Program code idx := __CURRENTTASK.TaskIndex; pInfo := __CURRENTTASK.pTaskInfo;