Compiler Error C0549

Message: Initialization of the static variable '<variable name>' is not constant, or replaced constants is disabled.

Possible error causes:

Example:

The Replace constants compile option is disabled.

VAR CONSTANT
    iMaxInst : INT := 2;
END_VAR
VAR_STAT
    iIDs : INT := iMaxInst - 1;
END_VAR

Message:

C0549: Initialization of the static variable 'iIDs' is not constant, or replaced constants is disabled.

Error correction:

In Project → Project Settings, on the Compile Options tab, enable the Replace constants compile option.