The Tools > Options > Smart Coding dialog box provides settings for making coding easier. This concerns the smart coding functions like for example, AutoDeclaration or Input Assistant.
Declare Unknown Variables Automatically (AutoDeclare)
If the option Declare unknown variables automatically (AutoDeclare) is activated, the Auto Declare dialog box opens automatically when you enter a not yet declared identifier in a programming language editor.
Show all Instance Variables in Input Assistant
If the option Show all instance variables in input assistant is activated, the List Components function allows you to select the local variables of a function block instance.
If the option Show all instance variables in input assistant is not activated, the List Components function allows you to select only the input variables and output variables of a function block instance.
Show Symbols From System Libraries in Input Assistant
System libraries are libraries that are marked in gray in the Library Manager, as they were inserted automatically by the system (when having added a certain device or object to the project).
If the option Show Symbols From System Libraries in Input Assistant is activated, symbols from system libraries, such as global variables, data types, and function blocks, are available for selection in the Input Assistant.
If the option Show Symbols From System Libraries in Input Assistant is not activated, symbols from system libraries are not available in the Input Assistant.
List Components After Typing a Dot (.)
If the option List components after typing a dot (.) is activated, the List Components function is activated. This means that when entering a dot (.) in an editor at a position where an identifier is expected, a selection list is displayed with possible entries.
List components immediately when typing |
If activated: when you enter a character in the editor, a list opens which contains the available identifiers and operators. This is also a List Components functionality. Depending on which character sequence you have entered, the first entry of this list matching this character sequence will be selected. You can select a list item and by pressing RETURN, place it at the cursor position. |
Insert with namespace |
When you enter an identifier, the namespace is automatically added as prefix. For example, if you press Ctrl + Space in the declaration editor and select TON - provided by the standard.library - from the selection list, then Standard.TON is inserted. |
Convert Keywords to Uppercase Automatically (Autoformat)
If the option Convert keywords to uppercase automatically (Autoformat) is activated, the keywords used in text sections of editors are written in capital letters automatically.
Example: If you enter bVar:bool;, this is converted to bVar:BOOL;
Automatically List Selection in Cross Reference View
If the option Automatically list selection in cross reference view is activated, the Cross Reference View automatically lists the references of the variable selected in the active editor.
Compiler Messages in the Editor
Positions in your application which will lead to precompile or compile alerts (errors) and precompile or compile advisories (warnings), are marked in the programming language editors, in the library manager and in the project navigator (Devices tree). This is done by underlining the object (entry in the tree), variable, data type etc. like described in the following list.
NOTE: Not all issues will be detected in the precompilation phase. So, during compilation, more compiler messages can be reported.
NOTE: The POUs are checked, even those which are not used by any application. This can have the effect that an application is built without detecting errors even though there are underlined sections in the code.
Compiler message |
Underlining |
---|---|
Precompile error (precompile alert) |
Red wavy line |
Compile error (compile alert) |
Two red lines |
Precompile warning (precompile advisory) |
Blue wavy line |
Compile warning (compile advisory) |
Two blue lines |
Collapsed node in the project navigator or library manager, containing impacted subnodes |
Two gray lines |
Even if the option is disabled, the referring compiler messages will appear in the respective category of the Messages view.