-

Variables Table - Toolbar, Context Menu

Note
In variables tables, the selection in drop-down lists is done with a single-click, not with a double-click.

Toolbar buttonContext menu commandDescription

Move Up

Move Down
Moves the selected variable(s) or variable group up or down.

Collapse All Groups

Expand All Groups
Collapses/expands all variable groups. The arrow icon in front of the group name shows whether a variable group is expanded or collapsed.

 : Group expanded.

  : Group collapsed.
-Select All

Cut, Copy, Paste, Delete
Operations are applied to the selected table lines. Default Windows shortcuts can be used for these commands.

Multi-selection can be done by pressing the <Ctrl> key or <Shift> key while clicking on the desired table lines. <Ctrl> + <A> selects all table lines.
Create VariableCreates a new variable.

To insert a variable into a specific group, left-click any cell in the desired group and execute the command.
Create GroupCreates a new variable group. The new group is created above the group containing the table line previously selected.
Remove Unused Variables

Remove Unused Global Variables
Removes all local and external variables and FB instance declarations from the 'Variables' table of the current POU. Unused means that the variable or instance is declared in the 'Variables' table but not used in any of the code worksheets in the current POU.
Import CSVImports variables from a .csv file (semicolon-separated values) into the grid.

Refer to the topic "Importing/Exporting Variables from/to a .csv File" for details.
Export CSVExports all declarations contained in the active grid to a semicolon-separated .csv file.

Refer to the topic "Importing/Exporting Variables from/to a .csv File" for details.

Note
If you edit the exported csv file with an external tool, you must make sure that the editor used does not change the column separators (semicolons) or the file encoding. For example, MS Excel may be set to modify csv files so that they cannot be reimported.

Show Initial Value ConfigurationOpens the 'Init Value Configuration' editor below the variables table where members of user-defined data types (ARRAYs and STRUCTs) can be initialized.
After selecting the declaration line of the user-defined data type in the variables table, its members can be edited in the grid of the 'Init Value Configuration' editor.

The button/command is not available in variables tables of safety-related POUs as they do not support user-defined data types.
-Cross ReferencesThe context menu command is only active if the cross references are collected and up-to-date (  is shown in the CROSS REFERENCES window).

Displays the cross references of the current variable. The 'References' submenu shows all references of the current object except the currently selected occurrence. Selecting a submenu entry directly jumps into the corresponding editor or data list ("jump-to functionality" like in the CROSS REFERENCES window).
-Locate in Cross ReferencesThe command is only active if the cross references are collected and up-to-date (  is shown in the CROSS REFERENCES window).

Opens the CROSS REFERENCES window and marks the respective entry for this variable.
-Show all ReferencesThe command is only active if the cross references are collected and up-to-date (  is shown in the CROSS REFERENCES window).

Like 'Locate in Cross References' (prev. table row), this command opens the CROSS REFERENCES window and marks the respective entry for this variable. In addition, the cross reference list is automatically filtered for occurrences with the same 'Name', 'Type' and 'Kind'. For local variables, the POU name is used as filter criterion too.
For more details, refer to section "Showing cross references out of the code ..." in the "CROSS REFERENCES Window" topic.
-Go To Instance EditorGoes to the program/function block instance where the selected variable/FB instance is used (the command is only available in debug mode).

The submenu of the command lists all programs/FB instances where the element is used (in the format 'PLC.ProgramInstance' for program instances and 'PLC.ProgramInstance.FBInstance' for FB instances). Selecting an entry opens the code worksheets and 'Variables' worksheet of the POU instance in debug mode.
-Add to Watch Window

Shortcut:
<Ctrl>+<Alt>+<5>
Inserts the selected variable into the WATCHES window for monitoring/debugging purposes.

The command is only available in debug mode, i.e., after selecting an instance of the variables table.
-Add to Logic Analyzer

Shortcut:
<Ctrl>+<Alt>+<6>
The command is only available in debug mode.

Inserts the selected variable into the LOGIC ANALYZER window for recording variable values from the running controller and visualizing them graphically as curves.
-Overwrite/ForceForces/overwrites the selected variable. Which command is available depends on the variable type. Refer to the topic "Debugging code: Forcing/Overwriting ‣ Debugging Code: Forcing/Overwriting
×‣ Debugging Safety-Related Code: Forcing/Overwriting
×
" for details.

The command is only available in debug mode, i.e., after selecting an instance of the variables table.
- RefactoringOpens the REFACTORING window in the Cross Function Area. The window shows all references of the object (variable, FB instance, etc.) for which the command was executed. Using the window, you can perform an automatic solution-wide replacement of object properties.

For more details, refer to the topic "Refactoring Variables".