Configuration | Naming conventions Please note: The description of NC0151: Structure is transferable to the following DUT types. NC0152: Enumeration NC0153: Union NC0154: Alias 4.3.1.17 NC0160: User-defined type | NC0160: User-defined type Available from TwinCAT 3.1 Build 4026 The convention that you define under NC0160 has priority over the prefixes defined with the attribute Attribute {attribute 'nameprefix' := '...'} [ } 124] . NC0160: User-defined type is an organizational node for configuring a prefix for special user-defined types, especially those from libraries or for read-only types (e.g. PVOID , HRESULT ). You can expand the list with conventions: click the blank line below.
Then enter the name of a user- defined type or select a user-defined type in the Input Assistant dialog. You can delete a convention by selecting it and choosing the Del key. Sample In the ‘Name’ column, enter the read-only system data type PVOID on a blank line below the prefixes for user-defined types. In the same row, in the ‘Prefix’ column, enter the desired prefix, e.g. p . Variables of type PVOID are checked for this prefix when running Static Analysis. More examples of user-defined types whose desired prefix you can configure at this point:
System data type HRESULT Function block TON from the Tc2_System library 4.3.2 Options | Options In the Naming Conventions tab, you will find options that extend the configuration of the prefixes. You can use these options to configure how the expected overall prefix for variables/declarations should be composed. 1) First character after prefix should be an upper case letter If enabled: The static code analysis reports an error for a variable if the first character of the variable name after the defined prefix is not an upper case letter. If disabled: Upper case/lower case spelling is not checked. Default setting: disabled Samples:
Variable "bvar" with the expected prefix "b" Function block "FB_sample" with the expected prefix "FB_" TE1200 89 Version: 2.11.1 Option State Result of the static analysis First character after prefix should be an upper case letter Enabled For the definitions mentioned above, an error will be reported in each case that the first letter after the prefix must be an upper case letter. Correct identifiers would be "bVar" and "FB Sample". _ Disabled The identifiers "bvar" and "FB sample" are permissible. No upper/ _ lower case error is output.