Default shortcut: SHIFT + F2
The declaration of a variable. The command is available when the cursor is placed in the declaration or in the implementation part of the editor. If an already declared variable is selected, the dialog box will show the respective declaration data. If the cursor is placed in a line containing a not yet declared variable, the dialog box primarily just shows the variable name and the default declaration settings.
command opens the dialog box for theTo display the dialog box automatically as soon as a line containing a not yet declared variable is left, activate the respective option in the dialog box.
The SmartTag function allows you to access the command when you place the cursor over an undeclared variable in the implementation part of the ST editor and click the icon .
Some fields will be filled automatically with default values, but still can be edited. A red exclamation mark icon indicates fields which contain non-valid settings (for example: combination of
with address specification, activated while not having activated the ).
Element |
Description |
---|---|
|
By default, the name of the new variable which you have entered in the editor. |
|
By default, the name of the currently edited object. To define another object where the variable declaration should be performed, select one of the available objects.
For example, if you are going to declare a global variable ( |
|
By default, INT. If this is the first variable in the line: INT. If there is already a declared variable in the line, the type of this variable is preset. For modifying this entry, you can press the button to open the dialog box. It allows you to select one from all possible data types. In case you want to declare an array variable, you can use the array wizard which is offered also via the arrow button. Refer to the description. |
|
By default, VAR (local variable). Alternatively, set another scope from the selection list. |
|
Here you can enter an explicit initialization value for the variable. If the field is left empty, the variable will be initialized with the default value. Use the button to get assistance by the dialog box, which can be useful for the initialization of structured variables.The dialog box lists the names of the variables ( ), the currently applied and the . Basically, the default values will be displayed as defined in the declaration of the data type. To change a value, enter the desired new value in the edit field below the table, select the respective expressions and click the button. Modified initialization values will be displayed bold. You can restore the default initialization values via the button.
Example: A variable ![]() After confirmation with , the dialog box is closed and the initialization values are applied to the dialog box. Note that only variables with modified initial values are reinitialized explicitly. |
|
By default, empty. You can add an IEC address of the application for the variable that is being declared (AT declaration).
Example:
NOTE: You can add an IEC address only for the following validity ranges:
|
|
If applicable, enter a comment. You can format the comment text with line breaks by using the keyboard shortcut CTRL+ENTER. It will appear in the declaration part of the object in the line above variable declaration. |
|
, , :
Activate the desired option to define the type of variable. The respective attribute will be added to the keyword set in the field, for example
If the |