Skip to main content

Compiler Warning C0515

Message: Should not access protected property <POU name>.<property name>

Possible error cause: A property of the POU, whose visibility is restricted with the PROTECTED keyword, is accessed from outside of the POU or its inheritance hierarchy.

Error correction: Change the visibility of the property (for example, remove the PROTECTED keyword) or change the declaration of the variables.

Example 483. Example of the warning
FUNCTION_BLOCK POU
VAR_INPUT
END_VAR
...

PROPERTY PROTECTED Prop : UDINT

PROGRAM PLC_PRG
VAR
      p:POU := STRUCT(Prop := 7);
END_VAR

The declaration of the variable p produces the following warning:

Message:

C0515: Should not access protected property POU.Prop