Attribute 'hide_all_locals'

This attribute works like the Attribute 'hide'. The only difference is that the 'hide' attribute affects only one variable, where all local variables of a signature are affected by the 'hide_all_locals' attribute.

Note that variables declared with the 'hide' or 'hide_all_locals' attribute cannot be saved as persistent. Furthermore, the generation of the associated process image (allocated inputs/outputs) is prevented for "hidden" variables. Furthermore, no (ADS) symbols are generated for these variables. In other words, symbolic access is prevented.

Syntax: {attribute 'hide_all_locals'}

Insertion location: First line above the declaration part of the POU

Sample:

The function block FB_Sample uses the attribute:

{attribute 'hide_all_locals'}
FUNCTION_BLOCK FB_Sample 
VAR_INPUT 
    nA     : INT; 
END_VAR 
VAR_OUTPUT 
    bB     : BOOL; 
END_VAR 
VAR 
    nC,nD  : INT;
    bE     : BOOL;
END_VAR

The effect of the attribute 'hide' when using the attribute 'hide_all_locals' with the function block FB_Sample affects all local variables of the function block (nC, nD, and bE).

See also: