GETCURTASKINDEXEX

GETCURTASKINDEXEX 1:

The function determines the task index of the task in which it is called. In contrast to the function block GETCURTASKINDEX, a distinction can be made as to whether the function is called in a cyclic real-time context or not.

FUNCTION GETCURTASKINDEXEX : DINT

VAR_INPUT
    (*keine*)
END_VAR

Return parameter

Description

-1

The function is called from the Windows context.

0

The function is called from the real-time context, but not from a cyclic PLC task. This is the case, for example, with the automatic call of FB_init methods during initialization.

1 to n

The function is called from a cyclic PLC task. The return value is the task index.

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)