Skip to main content

Compiler Error C0238

Message: No initial value allowed for VAR_EXTERNAL <variable name>

Possible error cause: An attempt is made to initialize a variable in VAR_EXTERNAL.

Error correction: Do not initialize variables in VAR_EXTERNAL.

Example 456. Example of the error:
PROGRAM PLC_PRG
VAR_EXTERNAL
    ig : INT := 2;
END_VAR

VAR_GLOBAL
    ig : INT;
END_VAR

Message:

C0238: No initial value allowed for VAR_EXTERNAL ig