__POSITION
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:
- Declaration part:
Line <line number> (Decl)
- Implementation part:
Line <line number>, Column <Column number> (Impl)
Sample:
PROGRAM MAIN
VAR
sPositionDecl : STRING := __POSITION(); //Liefert die Zeilennummer dieser Deklaration
sPositionImpl : STRING;
END_VAR
sPositionImpl := __POSITION(); //Liefert Zeilen- und Spaltennummer dieser Zuweisung