Using the Declaration Editor

The declaration editor is used for declaring variables in the variable lists and POUs.

The declaration editor offers two possible views: textual and tabular .

in the dialog in Tools ‣ Options ‣ Declaration Editor , you define whether only the textual view or only the tabular view is available, or whether you can switch between both views by means of the buttons on the right side of the editor view.

If the declaration editor is used in conjunction with a programming language editor, it appears as the declaration part at the top of the window of a POU.

Declaring in the textual declaration editor

The behavior and the appearance of the textual editor are configured with the settings in the dialog Tools ‣ Options ‣ Text editor . The settings concern colors, line numbers, tab widths, indentations etc. The usual Windows functions are available, plus the IntelliMouse functions if necessary.

Requirement: You have opened a programming object (POU, GVL or NVL) of a project. The textual declaration editor has the focus.

  1. Enter the variable declarations in correct syntax. With F2 you can open the dialog Input Assistant for the selection of the data type or a keyword.

Declaring in the tabular declaration editor

In the tabular declaration editor, you add variable declarations to a table with the following columns: Scope, Name, Address, Data type, Initialization, Comment, and Attributes (pragmas).

Requirement: A programming object (POU or GVL) of a project is open. The tabular declaration editor has the focus.

  1. Click the button in the declaration header or select the command Insert in the context menu.

    ⇒ CODESYS inserts a new row for a variable declaration and the input field for the variable name opens.

  2. Specify a valid variable identifier.

  3. Open the other fields of the declaration line as required with a double-click and select the desired specifications from the drop-down lists or with the help of the dialogs which appear.

See also