Skip to main content

演算子:__POSITION

演算子は、IEC61131-1規格の拡張です。

実行時に、オペレーターはPOUの宣言部分または実装部分で変数の位置を生成します。演算子には、タイプの変数を割り当てる必要があります STRING 宣言部分または実装部分で。

. の結果 __POSITION
  • 宣言部分: 'Line <line number> (Decl)'

  • 実装部分: 'Line <line number>, Column <Column number> (Impl)'

157.
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