Function: In the dialog, you define the prefixes for the data types and scopes of variables, as well as prefixes for POUs and user-defined data types (DUTs). Static analysis checks compliance with the naming conventions. When a convention is not observed, the static analysis reports an error message in the “Messages” view.
Call:
-
Menu bar: “Project Project Settings”, “Static Analysis” category, “Open configuration dialog” link
-
Menu bar: “Build Static analysis Settings”
Requirement:
-
The CODESYS Static Analysis package is installed.
-
A project is open.
The error messages are displayed in the following format:
NC <prefix convention number> :
<message text>
. NC stands for "Naming Convention". For example, the error message "“NC0102: Invalid name...”" means a violation of naming convention 102 for POUs of type
PROGRAM
.
You can use the pragma 'naming'
to deactivate naming conventions for individual identifiers. The identifiers can
begin with anything, not necessarily with the prefix.
“Filter” |
Input field for strings to be searched for |
Table with the naming conventions |
|
“Names” |
Nodes and elements for which a prefix can be defined. The number in parentheses after each element (for example, “PROGRAM (102)”) is the prefix convention number that is reported in the case of noncompliance with a naming convention. |
“Prefix” |
Input field of the prefix
|
“Prefixes for variables” |
Organizational node for all variables for which a prefix can be defined dependent on data type or scope. |
“Prefixes for POUs” |
Organizational node for all POU types and method scopes for which a prefix can be defined |
“Prefixes for DUTs” |
Organizational node for the DUT data types (structure, enumeration, alias, or union) for which a prefix can be defined |
“Prefixes for custom types” |
Organizational node for special custom types (particularly those from libraries) You can extend the list with conventions: Click the blank space below it. In the “Input Assistant” dialog, specify the name of a custom type or select a custom type. To delete a convention, select it and press the [Del] key. Note: These conventions have priority over the prefixes which are defined with the
attribute |
Options |
|
“First character after prefix should be an upper case letter” |
|
“Combine scope prefix with data type prefix” |
Example: The following prefixes are defined:
Example: The following prefixes are defined: |
“Recursive prefixes for combinable data types” |
Example:
The prefix
The prefix |
Example
The following naming convention corresponds for the most part to the recommendations described in the "Identifiers" chapter.



Example
The naming convention (1) refers to the standard POU TON
. As a result, declarations of the special library POU are checked for the prefix
"ton_". Click the blank space (2) to insert more naming conventions.
