Skip to main content

Compiler Error C0228

Message: No initial value for constant variable '<constant name>'

Possible error cause: A constant is not initialized.

Error correction: Initialize the constants.

Example 448. Example of the error:
PROGRAM PLC_PRG
VAR
END_VAR
VAR CONSTANT
    k : INT;
END_VAR

Message:

C0228: No initial value for constant variable 'k'

Error correction:

k : INT := 1;