Attribute ‘hide’¶
This pragma prevents variables from being visible in the display of the ‘List components’ function, in the input assistant or in the declaration part in online mode.
Syntax:
{attribute 'hide'}
Insertion position: line above the line with the declaration of the variables.
Example
The function block myPOU uses the attribute {attribute 'hide'}
:
FUNCTION_BLOCK myPOU
VAR_INPUT
a:INT;
{attribute 'hide'}
a_invisible: BOOL;
a_visible: BOOL;
END_VAR
VAR_OUTPUT
b:INT;
END_VAR
Two instances of the function block myPOU are defined in the main program.
PROGRAM PLC_PRG
VAR
POU1, POU2: myPOU;
END_VAR
While an input value for POU1
is now implemented, the ‘List components’ function, which opens when typing POU1.
(in the implementation part of PLC_PRG), displays the variables a
, a_visible
and b
, but not the hidden variable a_invisible
.
Note
With the pragma hide_all_locals
you can hide all local variables of a declaration.
Note
If the pragma hide
is used in compiled libraries for variables and signatures, these variables and signatures are also not displayed in the library manager.
See also