Skip to main content

Compiler Warning C0513

Message: Should not access private property <POU name> <property name>

Possible error cause: A property of the POU, whose visibility is restricted to the POU with the PRIVATE keyword, is accessed from outside of the POU.

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

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

PROPERTY PRIVATE Prop : UDINT

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

The declaration of the variable p produces the following warning.

Message:

C0513: Should not access private property POU Prop