SA0027: Multiple usage of name
Function | Determines multiple use of a variable name/identifier or object name (POU) within the scope of a project. The following cases are covered:
|
Reason | Identical names can be confusing when reading the code. They can lead to errors if the wrong object is accessed inadvertently. Therefore, define and follow naming conventions in order to avoid such situations. |
Exception | Enumerations declared with the 'qualified_only' attribute are exempt from SA0027 checking because their elements can only be accessed in a qualified manner. |
Importance | Medium |
Sample:
The following sample generates error/warning SA0027, since the library Tc2_Standard is referenced in the project, which provides the function block TON.
PROGRAM MAIN
VAR
ton : INT; // => SA0027
END_VAR