__POSITION

__POSITION 1:

Available from TC3.1 Build 4026.

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

The operator returns the position of a variable in the declaration part or in the implementation part of a programming block at runtime. For this purpose, the operator __POSITION must be assigned to a variable of type STRING in the declaration part or in the implementation part.

Result of __POSITION:

Sample:

PROGRAM MAIN
VAR
    sPositionDecl  : STRING := __POSITION();   //Liefert die Zeilennummer dieser Deklaration
    sPositionImpl  : STRING;
END_VAR
sPositionImpl := __POSITION();                //Liefert Zeilen- und Spaltennummer dieser Zuweisung