Detects multiple uses of a name/identifier for a variable or an object (POU) within the scope of a project
Justification: Same names can be confusing when reading the code. They can cause errors if the wrong object is accessed accidentally. Define and follow naming conventions to avoid any situation like this.
The following cases are detected:
-
The name of an enumeration is identical to the name of another enumeration in the application or in an integrated library.
-
The name of a variable is identical to the name of another object in the application or in an integrated library.
-
The name of a variable is identical to the name of an enumeration constant in an enumeration in the application or in an integrated library.
-
The name of an object is identical to the name of another object in the application or in an integrated library.
Importance: Medium
Example
The Standard
library is integrated in the project and provides the TON
function.
PROGRAM PLC_PRG VAR ton : INT; END_VAR --> Variable name 'ton' in 'PLC_PRG' already used for an object in library 'standard, ...'