Skip to main content

Compiler Error C0039

Message: VAR_IN_OUT '<invalid variable>' must be assigned in call of '<function block name>'

Possible error cause: An IN_OUT variable is not passed to a function block that requires an IN_OUT variable.

Error correction: Assign the IN_OUT variable.

Example 338. Example of the error:
PROGRAM PLC_PRG
VAR
    inst : FB;
END_VAR
inst();

FUNCTION_BLOCK FB
VAR_IN_OUT
    inout : INT;
END_VAR

Message:

C0039: VAR_IN_OUT 'inout' must be assigned in call of 'FB'

Error correction:

inst(inout := i);