Operator ‘__POSITION’ΒΆ

The operator is an extension of the IEC 61131-1 standard.

At runtime, the operator yields the position of a variable in the declaration part or in the implementation part of a POU. The operator has to be assigned the variables of type STRING in the declaration part or in the implementation part.

Result of __POSITION

Example

PROGRAM PROG1
VAR
        strPOS : STRING := __POSITION();  //Yields the line number of this declaration
        strlocalPOS : STRING;
END_VAR

        strlocalPOS := __POSITION();      //Yields the line and column number of this assignment