__POUNAME
Available from TC3.1 Build 4026. |
The operator is an extension of the IEC 61131-1 standard.
The operator returns the name of the program organization unit (POU) containing the __POUNAME operator at runtime. To do this, the operator must be assigned to a variable of type STRING
in the declaration part or in the implementation part.
The result of __POUNAME depends on where it is used:
- Within a program: program name
- Within a function: function name
- Within a function block: name of the function block
- Within a method: name of the method, qualified with the name of the function block
- Inside a Get/Set accessor in a property: name of the property, qualified with the name of the function block, + Get/Set
- Within a GVL: name of the GVL
- Within a structure: name of the structure
- Within a data structure UNION: name of the UNION
Sample:
PROGRAM MAIN
VAR
sPouNameDecl : STRING := __POUNAME(); //Liefert 'MAIN'
sPouNameImpl : STRING;
END_VAR
sPouNameImpl:= __POUNAME(); //Liefert 'MAIN'