Skip to main content

Compiler Warning C0540

Message: Attribute 'no_assign' missing for POU '<POU>'. The type of the variable '<variable>' is attributed with 'no_assign'.

Possible error cause: A POU X contains a variable, whose type (POU Y) has the 'no_assign' attribute. POU X has no 'no_assign' attribute.

Error correction: Also decorate the POU with the 'no_assign' attribute.

Example 489. Example of the warning
{attribute 'no_assign'}
FUNCTION_BLOCK FB_NotAssignable
VAR
      pBool : POINTER TO BOOL;
END_VAR

FUNCTION_BLOCK FB_WrapperOfNotAssignable
VAR
      fbNotAssingable : FB_NotAssignable;
END_VAR

The declaration of the variable fbNotAssignable produces the following warning.

Message:

C0540: Attribute 'no_assign' missing for POU 'FB_WrapperOfNotAssignable'. The type of the variable 'fbNotAssingable' is attributed with 'no_assign'.

Error correction: Also decorate the FB_WrapperOfNotAssignable POU with the 'no_assign' attribute.