GETCURTASKINDEX

GETCURTASKINDEX 1:
GETCURTASKINDEX 2:

Outdated function block

This function block is outdated. Use the function GETCURTASKINDEXEX() instead.

The function block GETCURTASKINDEX determines the task index of the task in which it is currently called.

To differentiate whether the current call occurs in the real-time context or from a cyclic PLC task, see the documentation for the function GETCURTASKINDEXEX. For example, the automatic call of FB_init methods during initialization does not occur from a cyclic PLC task.

GETCURTASKINDEX 3: Inputs

VAR_INPUT
(*none*)
END_VAR

GETCURTASKINDEX 4: Outputs

VAR_OUTPUT
    index : BYTE;
END_VAR

Name

Type

Description

index

BYTE

Returns the current task index of the calling task (1..4 ).

Example of calling the block in FBD:

GETCURTASKINDEX 5:

Requirements

Development environment

Target system type

PLC libraries to include (Category group)

TwinCAT v3.1.0

PC or CX (x86, x64, ARM)

Tc2_System (System)