Variables

Variables are defined for their scope. For instance, controller variables are global, for example, available for use throughout the programs, functions, and functions blocks of a controller. Whereas, variables defined for a program, a function, or a function block are local to that element. Define variables in the Variables grid of the Dictionary. For controller variables, create groups then add existing controller variables. Variables can belong to multiple groups. For individual variable scopes, import and export variables data having the Microsoft Excel (*.xls) or comma-separated values (*.csv) format.
Variable names are limited to 128 characters beginning with a letter or single underscore followed by letters, digits, and single underscores. The last character for a variable name must be a letter or digit; variable names cannot end with an underscore character. Reserved words, defined words, or data types such as, elementary, structures, or arrays, are not valid names. The same type of elements within a scope must have unique names.
When defining complex variables like arrays and structures, the syntax for the variable name is:
  • For arrays: arrayname[index]
    Name,Alias,Data Type,StringSize,InitValue,Direction,Wiring,Attribute ... array1,,BOOL,0,,, ... "array1[1,1]",,BOOL,0,,, ... "array1[1,2]",,BOOL,0,,, ... "array1[1,3]",,BOOL,0,,, ... "array1[1,4]",,BOOL,0,,, ... "array1[1,5]",,BOOL,0,,, ...
  • For structures: structurename.membername
    Name,Data Type,Dimension,Alias,Comment,InitValue,Direction ... structure1,,T9K_DI_FULL,0,, ... structure1.DI,,BOOL,0,, ... structure1.LF,,BOOL,0,, ... structure1.DIS,,BOOL,0,, ... structure1.CF,,BOOL,0,, ... structure1.V,,UINT,0,, ... structure1.STA,,USINT,0,, ...
When managing variables data, create groups for controller variables data.
When adding controller variables to a group, add these to the group from the variables grid or drag these between the variables grid and the group grid.

To create a controller variable group

  1. In the , expand the
    Variables
    item, right-click
    Groups
    , and then click
    Add New Variable Group
    .
    The group is added.
  2. To add a single variable to the group:
    • Open the controller variables grid, right-click the left most column for the required variable, point to
      Add to Group
      , and then click the required group.
  3. To add multiple variables to the group by dragging:
    1. Open the variables grid for the group by double-clicking and place both grids side-by-side.
    2. In the controller variables grid, select the consecutive variables, then click and drag from the cell having the arrow in the left most column to within the variables group grid.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal