Skip to main content

Avertissement du compilateur C0540

Message: Attribut 'no_assign' manquant pour le POU '<POU>'. Le type de variable '<variable>' est attribué par 'no_assign'.

Cause d'erreur possible: Un POU X contient une variable dont le type (POU Y) possède la 'no_assign' attribut. POU X n'a pas 'no_assign' attribut.

Correction d'erreur: Décorez également le POU avec 'no_assign' attribut.

Exemple 489. Exemple d'avertissement
{attribute 'no_assign'}
FUNCTION_BLOCK FB_NotAssignable
VAR
      pBool : POINTER TO BOOL;
END_VAR

FUNCTION_BLOCK FB_WrapperOfNotAssignable
VAR
      fbNotAssingable : FB_NotAssignable;
END_VAR

La déclaration de la variable fbNotAssignable produit l'avertissement suivant.

Message :

C0540 : Attribut 'no_assign' manquant pour le POU 'FB_WrapperOfNotAssignable'. Le type de variable « FBNotAssingable » est attribué par « no_assign ».

Correction d'erreur : décorez également le FB_WrapperOfNotAssignable POU avec 'no_assign' attribut.