Configuration | Rules 4.2.1.2.5 SA0025: Unqualified enumeration constants | SA0025: Unqualified enumeration constants Sample: Enumeration E_Color: TYPE E_Color : ( eRed, eGreen, eBlue ); END_TYPE MAIN program: PROGRAM MAIN VAR eColor : E_Color; END_VAR eColor := E_Color.eGreen; // no error eColor := eGreen; // => SA0025 4.2.1.2.6 SA0026: Possible truncated strings | SA0026: Possible truncated strings Samples: PROGRAM MAIN VAR sVar1 : STRING[10]; sVar2 : STRING[6]; sVar3 : STRING[6] := 'abcdefghi'; // => SA0026 END_VAR sVar2 := sVar1; // => SA0026 TE1200 32 Version: 2.11.1 Function Determines enumeration constants that are not used with a qualified name, i.e.
without preceding enumeration name. Reason Qualified access makes the code more readable and easier to maintain. Without forcing qualified variable names, an additional enumeration could be inserted when the program is extended. This enumeration contains a constant with the same name as an existing enumeration (see the sample below: "eRed"). In this case there would be an ambiguous access in this piece of code. We recommend using only enumerations that have the {attribute 'qualified-only’}. Importance Medium Function Determines string assignments and initializations that do not use an adequate string length. Reason If strings of different lengths are assigned, a string may be truncated.
The result is then not the expected one. Importance Medium