SA0118: Initialisations not using constants
Detects initializations that do not assign constants
Justification: Initializations should be constant if possible and should not refer to other variables. In particular, you should avoid function calls during initialization because this can allow access to uninitialized data.
Importance: Medium
Example 110. Example
PROGRAM PLC_PRG
VAR
dwTemp : DWORD := 22;
dwTest : DWORD := dwTemp; // SA0118
dwVar : DWORD := TempVarInFUNC(); // SA0118
END_VAR
Output in the Messages view:
SA0118: Initialisations not using constants