Attribute ‘hide’ΒΆ

This pragma prevents variables from being displayed in the CODESYS interface. For example, they are not visible in the input assistant or in the declaration part in online mode, and no debug functions can be applied.

Syntax:

{attribute 'hide'}

Insert location: The 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

When the input value for POU1 is implemented, the “List components” function, which opens when you type 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