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
Declaration part:
'Line <line number> (Decl)'
Implementation part:
'Line <line number>, Column <Column number> (Impl)'
Example 157. Example
PROGRAM PROG1 VAR strPOS : STRING := __POSITION(); //Returns the line number of this declaration strlocalPOS : STRING; END_VAR strlocalPOS := __POSITION(); //Returns row and column number of this assignment