Variables Grid

Use the variables grid of the
Dictionary
to manage the variables for a controller or program. Each controller and program has its instance of the grid. The grid displays global variables for controllers. The grid displays the local variables for programs. Perform these tasks from the variables grid:
Task
Procedure
Create a variable
  1. From the
    Application View
    , access the
    Dictionary
    instance for the required controller or program.
  2. In an empty row of the variables grid, define the required properties for the variable, and then press
    Enter
    .
Edit an existing variable
  1. From the
    Application View
    , access the
    Dictionary
    instance for the required controller or program.
  2. Make the required changes in the variables grid.
Drag a variable
Drag variables from a
Dictionary
instance to multiple locations within a project. These locations include other
Dictionary
instances and elements within a language container.
Drag variables to other locations individually. When dragging a variable to another
Dictionary
instance, place the variable anywhere in the grid. When dragging a variable into a language container, place the variable anywhere in the language container. To retain changes made to
Dictionary
instances and language containers, save the respective instance or POU before closing.
  1. From the
    Application View
    , access the
    Dictionary
    instance containing the required variable and the destination for the variable.
  2. From the variables grid of the
    Dictionary
    instance containing the required variable, select the variable by clicking the cell in the left-most column.
  3. The selection indicator (dct_vg) is displays in the leftmost column.
  4. Drag dct_vg, placing the variable in the grid or open language container.
    The variable displays at the destination.
Delete a variable
Deleting variables from an instance opened for a program element removes the variables from the instance only.
  1. From the
    Application View
    , access the
    Dictionary
    instance for the required controller or program.
  2. Right-click the variable to remove in the variables grid, and then click
    Delete
    .
Cut, copy, and paste variables
When selecting variables, an indicator arrow (dct_vg) displays in the leftmost column of the grid. Cut, copy, and paste variables from one
Dictionary
instance to another. Also cut, copy, and paste variables from the
Variable Selector
to the Dictionary.
  1. In the grid of the required
    Dictionary
    instance, cut or copy the required variables.
    • To remove variables, select the required variable or variables, right-click the selection, and then click
      Cut
      .
    • To copy variables, select the required variable or variables, right-click the selection, and then click
      Copy
      .
  2. In the grid of the required
    Variable Selector
    tab or
    Dictionary
    instance, right-click the required location, and then click
    Paste
    .
Sort variables in the grid
Sort the variables in the grid using an ascending or descending order for the individual columns.
  1. From the
    Application View
    , access the
    Dictionary
    instance for the required controller or program.
  2. In the variables grid, select the required column header.
    An arrow showing the current order displays on the column header.
  3. Toggle the column header to switch between ascending and descending order.
Filter variables in the grid
When filtering, create a view displaying only the variables containing specified characters.
The filter row is the top row of the grid. Filter variables by typing alphabetical and numerical characters in the cells of the filter row. Also select from the drop-down combo box. Variables containing matching characters automatically display in the grid.
  1. From the
    Application View
    , access the
    Dictionary
    instance for the required controller or program.
  2. In the filter row of the variables grid, click the required cell, and then do one of these:
    • Type the characters to use in the filtering operation
    • Select the required defined word from the drop-down combo box
Add a variable to a variable group
In the variable grid, right-click the variable, point to
Add to Variable Group
, then click the required group.
TIP: Update each instance of a function or function block after adding, removing, renaming, changing data type, or changing direction of parameters in all POUs using the instance. Identify these POUs with the
Cross Reference Browser
, then open each POU and reselect the modified instance using the
Block Selector
.
For variables of controllers or programs, the properties are:
Column
Description
Possible Values
Name
Name of the variable
Limited to 128 characters beginning with a letter or single underscore character followed by letters, digits, and single underscore characters. The last character for a variable name must be a letter or digit; variable names cannot end with an underscore character. Do not use reserved words, defined words, or data types (elementary, structures, or arrays) for names. Names must be unique for the same type of elements within a scope.
Logical Value
Available when online. The display value depends on the direction of the variable. In the dictionary view, the columns display values for the variables used in controllers where debugging is enabled.
Input: Locked
Output: Updated by the running TIC code
Internal: Locked
Physical Value
Available when online. The display value depends on the direction of the variable. In the dictionary view, the columns display values for the variables used in controllers where debugging is enabled.
Input: Updated by the field value
Output: Locked
Internal: Updated by the running TIC code
Lock
Available when the application is connected. The value of the variable is locked. Enables locking only I/O variables. Locking operates differently for simple variables, array and structure elements, and function block parameters. For simple variables, individual variables are locked directly. For structure and array elements, locking an element locks only that element of the structure or array.
Yes or No
Data Type
Data type of the variable.
Avoid using library data types.
BOOL, BYTE, DATE, DINT, DWORD, INT, LINT, LREAL, LWORD, REAL, SINT, STRING, TIME, UDINT, UINT, ULINT, USINT, WORD, user arrays, and structures
Dimension
Size (number of elements) of an array
For example: [1..3,1..10] - represents a two-dimensional array containing a total of 30 elements.
TIP:
Dimension
does not apply to function block instances. Avoid setting
Dimension
for function block instances to help prevent unexpected build results.
String Size
Maximum length for String-type variables
String capacity has a maximum of 255 characters excluding the terminating null character (0), a byte for the current length of the string, and a byte for the maximum length of the string. The default value is 80.
Initial Value
Value held by a variable when the virtual machine starts the execution of the controller
The initial value of a variable. Possible values are the default value, a value assigned by the user when defining the variable, or the value of the retain variable after the virtual machine has stopped.
TIP: Use a decimal value only. Hexadecimal values are not supported.
Direction
For local variables of a program organization unit (POU), indicates whether the variable is internal, an input, or an output.
Possible values are Var, VarInput, or VarOutput. When wiring the local variable of a program, the direction changes to match the direction required by the I/O device.
For global variables of a controller, indicates whether the variable is internal, an input, an output, or a system variable.
Possible values are Var, VarInput, VarOutput, VarGlobal, or VarDirectlyRepresented. When wiring a variable, the direction changes to match the direction required by the I/O device.
Attribute
Read and write access rights of a variable
Possible values are Read, Write, or Read/Write. The possible values depend on the direction of the variable. When wiring a variable, the attribute changes to match the direction required by the I/O device.
Retained
The controller saves the value of the variable in non-volatile memory at each cycle.
When setting the
Retained
property for a variable with a structure data type, the property is set for the entire structure; individual structure members cannot be retained.
Limitations:
  • Do not use the
    Retained
    property for safety-related settings.
  • Do not set the
    Retained
    property on wired T9K_xx_FULL structures.
True or False
When the processor battery voltage is low or no battery is fitted, setting Retained to True has no effect.
Comment
User-defined text
Plain text
Alias
Any name (for use in POUs)
Limited to 128 characters consisting of letters, digits, and these special characters: !, #, $, %, &, \, *, +, -, /, <, :, =, >, ?, @, ^, _, `, |, and ~.
Wiring
(Read-only) Generated by the I/O wiring tool indicating the I/O channel wired to the variable
Uses the syntax of directly represented variables
Groups
Group name or "None"
Allow OPC Write
An external client can write to the variable. Only available for user-defined variables or user-defined instances of function blocks.
The default value is FALSE
Message True
Message defined for the TRUE value message
Limited to 65535 characters
Message False
Message defined for the FALSE value message
Limited to 65535 characters
Customize the
Dictionary
environment by arranging the columns to display.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal