Using the Declaration Editor
The declaration editor is used for declaring variables in the variable lists and POUs.
Two views are provided in the declaration editor.
: Tabular view
: Textual view
In the Tools → Options → Declaration Editor dialog, you can set whether only the textual view or only the tabular view should be available. Or whether you can toggle between the two views using the buttons on the right-edge 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 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).
Note
The tabular view does not require detailed knowledge of the syntax.
Requirement: A programming object (POU or GVL) of a project is open. The tabular declaration editor has the focus.
Click the
button in the declaration header or click Insert in the context menu.
A new row for a variable declaration is inserted and the input field for the variable name is opened.
Specify a valid variable name.
Open the other fields of the declaration line as required with a double-click and select the desired specifications from the list boxes or with the help of the dialogs which open.
For more information, see: Auto Declare
Declaring in the textual declaration editor
The behavior and the appearance of the textual editor are configured with the settings in the 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.
If you have opened a POU, GVL, or NVL and have set the focus to the text declaration editor, then specify the variable declarations. Pay attention to the syntax. Press F2 for support and to select a data type or keyword using the Input Assistant.
Tip
You can save yourself from typing by using shortcuts for the scope or the variable type.
For more information, see: Shortcuts for Variable Declaration