The operator is an extension of the IEC 61131-3 standard.
At runtime, the operator provides information about the IEC task that is currently running.
|
Tip |
|---|---|
|
The operator is supported only on target systems in which the target system setting |
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 taskCan be assigned to a
POINTER TO Task_Info2from the libraryCmpIecTask
The operator cannot be used in the declaration of a POU. The would result in an error message. If the current task cannot be determined, then the TaskIndex -1 and the pTaskInfo are zero.
Example 154. Example
//Declaration
VAR
idx : INT;
pInfo : POINTER TO Task_Info2;
END_VAR
//Program code
idx := __CURRENTTASK.TaskIndex;
pInfo := __CURRENTTASK.pTaskInfo;