Skip to main content

Dialog: Options: SmartCoding

Symbol: _cds_icon_option_smart_code.png

Function: The dialog is used to configure the settings which make for easier coding.

Call: Tools → Options command, SmartCoding category

Declare unknown variables automatically (AutoDeclare)

_cds_icon_checked.png: The Auto Declare dialog opens when you type an undeclared identifier into an implementation language editor and then click away from the input line.

In order for the AutoDeclare function to be available in the ST editor as well, the Enable for ST editor option also has to be selected.

Enable for ST editor

Requirement: The Declare unknown variables automatically (AutoDeclare) option is selected.

_cds_icon_checked.png: The AutoDeclare function is also available in the ST editor.

_cds_icon_option_deactivated.png: The AutoDeclare function is not available in the ST editor.

Show all instance variables in input assistant

_cds_icon_checked.png: The List components function also lets you select the local variables of a function block instance.

_cds_icon_option_deactivated.png: The List components function lets you select only the input variables and output variables of a function block instance.

Show symbols from system libraries in input assistant

System libraries are automatically inserted in the Library Manager and displayed in light gray.

_cds_icon_checked.png: The Input Assistant offers symbols, such as global variables, data types, and function blocks.

_cds_icon_option_deactivated.png: The symbols of the system libraries are not available in the Input Assistant.

List components after typing a dot (.)

_cds_icon_checked.png: Enables the List components function

When you type a dot (.) at a location where CODESYS expects an identifier, a list box opens, offering possible code.

List components immediately when typing

Requirement: The List components after typing a dot (.) option is selected.

_cds_icon_checked.png: While you type code, a list box opens, offering possible identifiers and operators.

Insert with namespace

_cds_icon_checked.png: CODESYS adds the namespace before the identifier.

Convert keywords to uppercase automatically (AutoFormat)

_cds_icon_checked.png: CODESYS automatically displays all keywords in uppercase.

Automatically list selection in cross reference view

_cds_icon_checked.png: The cross-reference list automatically displays the references of variables, POUs, and DUTs which are currently selected or where the cursor is positioned.

Underline Errors in the Editor

_cds_icon_checked.png: Incorrect or unknown program code is underlined.

This option is used to enable or disable the precompile feature.

It should be noted that not all errors are recognized in the precompile phase because no code is generated in this phase. 

Unrecognized errors are especially those errors which occur when allocating the data, for example when the available memory for the data runs out.

In addition, in the precompile phase errors can also occur which are not relevant when generating the code.

One example of errors which are reported but are not relevant when generating code: problems which are reported in function blocks that are not used anywhere. If there is no instance of the type of a function block, then the compiler is not interested in this function block, but errors are still underlined in the editor.

Highlight symbols

_cds_icon_checked.png: All occurrences of a symbol where the cursor is positioned are highlighted in color within the editor. As a result, cross references within the editor are quickly detected.

Max degree of parallelism

List box for the number of parallel threads which can be used for the precompile processing

CODESYS detects the displayed number of threads from the number of CPU cores. This default number should be changed only in exceptional cases.