List of the declared variables
The tab Variables (below the drawing field of the →graphical editor) contains a list displaying all →variables and →function block instances (= instances) that are declared within the object.
The following illustrations depicts the list for an FBD function block:
By default, the tab Variables is not visible for the editor. You can make the area visible by the following possibilities (this is to be done per editor):
Click (left of the horizontal scroll bar below the drawing field).
From the context menu of the drawing field, select Show/Hide and Toggle Variable List.
Press Ctrl+L.
If the tab Namespace is in the foreground, change to the tab Variables.
If you want to hide the list (incl. Namespace), repeat one of the above possibilities for making the area visible.
Components of the list of the declared variables
Columns of the list
The following columns are visible within the list:
Column Name displays an icon for the variable/instance and the name of the variable/instance.
The following icons are displayed in the column:Icon
Meaning
internal →variable
instance of a →function block
variable with →user-defined data type
element from user-defined data type
These elements are displayed, if the variable is expanded .faulty variable
Possible causes for errors are:The data type does not exist.
The initial value does not match the data type. Example: initial value 100 for data type BOOL
The variable is declared repeatedly with the same name.
Usually, it is not possible to cause these errors within the graphical interface of logi.CAD 3 . However, the errors might be caused when the object is automatically created (e.g. during a migration).
Check the Problems view which message is displayed in order to identify the exact cause. Then correct the reported errors.unused variable
Column Section informs about the declaration of the variable/instance within the object.
The following information might be displayed in the column:Information
Declaration as
L
internal variable; or the instance of a function block
I
input variable
O
output variable
IO
in-out variable
G
global variable
EXT
external variable
Column Data type provides the →data type of the variable/instance.
Only within the FBD-editor : Column Usage informs how a variable is used. A usage is shown for an instance, only if a variable (e.g. an in-/output) of this instance is used within one →value field at least.
The following information might be displayed in the column:Information
Meaning
Read
The variable is used in one value field at least. Only the outputs of the value fields are connected to different FBD-elements.
Write
The variable is used in one value field at least. Only the inputs of the value fields are connected to different FBD-elements.
Write/Read
The variable is used in one value field at least. The outputs as well as the inputs of the value fields are connected to different FBD-elements.
The variable might also be used in several value fields -- at least one value field with the usage Read and a different value field with the usage Write.Used
The variable is used in one value field at least. Neither the inputs nor the outputs of the values fields are connected to different FBD-elements.
Unused
The variable has been declared but not used in any value fields.
This variable is also highlighted by the icon within the column Name.Column Initial value provides the →initial value of the variable/instance.
Column Attributes indicates the attributes for the variable/instance. At present, these attributes can only be specified when you are creating a value field with a new variable (by using a corresponding prefix).
Attribute
Meaning
CONSTANT
The variable is a →constant variable.
NON_RETAIN
The variable is a →non-retentive variable.
RETAIN
The variable is a →retentive variable.
Column Namespace provides the used →namespace.
Column Description provides a description of the variable/instance (also know as long name).
Column Comment provides a comment of the variable/instance.
If you do not need some items of information, you can hide the appropriate column:
Click (right of the columns) and select the appropriate column in the list (Checked columns are visible. Unchecked columns are hidden.)
If you require the items of information again, click again and select the appropriate column in the list.
It is possible to change the order of the columns as follows:
Point to the header of the column that you want to move. Then press and hold the primary mouse button, drag the column before or after a different column and release the primary mouse button.
Toolbar
The list provides a toolbar with buttons and an input field to filter the list content.
Creating new variables
See " Declaring variables " and " Declaring a Boolean local variable fast ".
Dragging variables/instances from list into the drawing field
This action is only provided within the FBD-editor .
If you drag variables/instances from the list into the drawing field, the appropriate FBD-elements are created in the drawing field. Details: see "Creating value fields and function block instances by dragging elements from the list of declared variables".
Changing data for a variable, e.g. the name or the data type
Deleting variables/instances
Finding the usages of a variable/instance
This action is only provided within the FBD-editor .
Toggling the fully qualified name of the type
This action is only applied within the FBD-editor .
Sorting variables/instance in the list
Variables/instances can be sorted by a column in ascending or descending order:
Click the column header that you want the sorting to be based on.
Result: in the column header indicates the descending order, indicates the ascending order.If you need to activate the other order type: Click on the column header again.
Filtering list content
By default, the list shows all variables/instances declared in the object.
How to filter the list to view only variables containing a particular text in columns Name or Data type:
Click into the input field above the columns and enter a filter text.
Result: A full text search is performed. The view lists only elements that are matching the filter text. The hierarchical view is adjusted: Levels without matches are hidden.
How to filter the list to view only variables with a particular declaration and/or instances:
Click one of the icons in toolbar above the columns.
Result: Only the variables of this declaration section or only the instances are displayed. The icon is displayed as being pushed.Icon
Meaning
internal variable
input variable
output variable
in-out variable
external variable
global variable
(only provided within a program)function block instance
Click a different icon in order to only display the variables of this declaration section or the instances.
Click and clear the settings within the dialog in order to hide the variables of these declaration sections and/or instances.
How to view all variable and /instances again:
Click into the input field above the columns and delete the filter text previously entered.
Click and select all settings within the dialog. Alternative outside of the filter dialog: If only one icon is displayed as being pushed: Click this icon within the toolbar.
If you create a new variable within the list of the declared variables, all variables of this declaration section are automatically displayed – even if these variables have been hidden before the creation.
Selecting variables/instances in the list
Select the first variable/instance by clicking onto it.
Press and hold the Ctrl-key or the Shift-key.
Select the next variable/instance by clicking onto it.
Result: If you have held the Ctrl-key, both variables/instances are selected. If you have held the Shift-key, all variables/instances in between are selected as well.Repeat the last step until all requested variables/instances are selected.
How to select all variables/instances in the list: Press Ctrl+A.
Expand/collapse variables/instances
Variables with subelements as well as instances are showing the icon in front of their name. By default, the subelements of variables and instances are not shown.
Use one of the following possibilities to show the subelements:
Click on icon of a variable or an instance.
Select one or several variables/instances, open the context menu and select the command Expand All.
Select one or several variables/instances and press one of the following keyboard shortcuts:
→ ( cursor movement key "Right")
+ ( plus character ) on the keyboard or numeric keypad
* ( multiplier character ) on the keyboard or numeric keypad
Use one of the following possibilities to hide the subelements:
Click on icon of a variable or an instance.
Select one or several variables/instances, open the context menu and select the command Collapse All.
Select one or several variables/instances and press one of the following keyboard shortcuts:
← ( cursor movement key "Left")
– ( minus character ) on the keyboard or numeric keypad