Skip to main content

Compiler Warning C0371

Message: Access to VAR_IN_OUT '<variable name>' declared in '<function block name>' from external context '<POU name>'

Possible error cause: A VAR_IN_OUT of the POU is accessed in a method of a POU.

Error correction: Either change the declaration of the variable or remove the assignment.

Example 471. Example of the warning
FUNCTION_BLOCK FB_Test
VAR_IN_OUT
      bInOut : BOOL;
END_VAR

METHOD METH: BOOL
VAR
      bBool : BOOL;
END_VAR
bInOut := bBool;

The assignment in the method produces the following warning.

Message:

C0371: Access to VAR_IN_OUT 'bInOut' declared in 'FB_Test' from external context 'METH'