'__POSITION'

Definition

This operator is not specified by the IEC 61131-3 standard.

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

Result of '__POSITION':

  • Declaration part: 'Line <line number> (Decl)'

  • Implementation part: 'Line <line number>, Column <column number> (Impl)'

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