Defining, viewing, and controlling variable groups

Overview

Variable groups can be defined, deleted, viewed, and have their state controlled.

The Variable Groups feature provides the function to:

  • Define and start a named variable group which contains one or more device variables
  • Read the device variables in the variable group at a defined frequency
  • If any of the device variables has changed since their last read, schedule any triggers with the Variable Group trigger event type and the named variable group.

Variable groups are defined on the node where the device variables are accessible.

The Variable Group trigger event type and Data trigger event type are similar in that they monitor the change of the value of a device variable (or multiple device variables). The differences include the number of device variables (single or multiple) and the variable value change conditions.

Defining variable groups

Variable groups are defined after the devices referenced for the device variables are defined and Started.
Follow these steps to add a variable group definition to a node:

  1. From the left pane, expand the node that you want to add a variable group definition to.
  2. Select the Devices icon.
    Then select the Variable Groups tab.
    Or, alternatively, select the Variable Groups sub icon.

    The Variable Groups window appears as the right pane.
    For this example, the Variable Groups window has previously defined variable groups.
  3. From the bottom of the Variable Groups tab, select New.
    A new Variable Group window appears.

  4. Enter a name for the variable group.
    This will be used to identity the variable group in the Variable Group trigger event type.
  5. Select a value for the Priority (ms) parameter.
    This is the frequency that the runtime Device Publisher feature will read the device variables.
    The units are in milliseconds (ms).
  6. Select the Add button to add device variables.
    The list of devices are the Started devices on this node.
    Expand the desired device and its internal structure until you can select the individual device variable.

  7. Continue to add device variables to the variable group until you have the complete list desired.
    Each variable has a Key, which will be available to the Variable Group event type trigger as an event variable. This is set to a default value when the variable is added to the group, but can be edited. This variable key can be used as a reference ID, or correlation ID, to help identify which variable's value in the group has changed.
    Variables can be deleted from this list, as well as moved up and down in the list.  The location in the list has no impact on the evaluation of the variable group, it is solely for list readability for the user.

  8. Use the Save button to save the definition of the variable group.
    The variable group will appear in the list of variable groups for the node, in a Stopped state.

Viewing variable groups

The Variable Groups tab provides a list of variable groups defined on the node.

To use the Variable Group tab, follow these steps:

  1. From Workbench left pane, expand the node whose variable groups you want to view.
  2. Select the Devices icon.
    Then select the Variable Groups tab
    Or, alternatively, select the Variable Groups sub icon.
  3. The Variable Groups tab provides a table format that lists the variable groups defined on the node.
    The top section of the Variable Groups tab provides these columns:

    Column name Description
    Name The name of the variable group. This will be used to identity the variable group in the Variable Group trigger event type.
    State The variable group state, which can be:
    Started - the variable group is active. The runtime Device Publisher is reading the device variables at the priority frequency.
    Stopped - the variable group is not active.
    Type The data type of the device variables.
    Count The number of device variables when the variable is an array.
    Length For String data types, the length of the string.

Variable group status information

The bottom portion of the Variable Groups window provides information for the selected variable group as follows:

Parameter name Description
Name The name of the variable group.
Priority The priority frequency in milliseconds that the device variables are read by the runtime Device Publisher.
Count The number of device variables when the variable is an array.
Last Modified The date and time that the variable group was last changed.
User The log in ID of the user that started the variable group.
Total Runs The number of device variables in the variable group.
State The variable group state, which can be:
Started - the variable group is active. The runtime Device Publisher is reading the device variables at the priority frequency.
Stopped - the variable group is not active.
Type The data type of the device variables.
Length For device variables with a String data type, the length of the string.
Last State Change The date and time of the last state change.
Inactivity

Use Count The number of Started Variable Group event type triggers that reference this variable group.

Variable group Variables section

The Variables section provides information for each of the device variables in the selected variable group as follows:

Column name Description
Device The name of the device where the variable resides.
Name The name of the device variable.
State The state of the device variable:
Active - the variable group is Started and the device variable can be read. The runtime Device Publisher is reading the device variables at the priority frequency.
Inactive - the variable group is not active.
Disabled - the variable group is Started, but the device variable can not be read. This is usually because the device is not in a Started state.
Error The last error code encountered when reading the device variable.

Controlling variable groups

When a variable group row is selected in the table, the buttons at the bottom of the Variable Groups tab become enabled or disabled. This is based on the current state of the variable group and the function of the button.

A single data variable group row or multiple variable group rows can be selected and then the function buttons used, but the state of each variable group will determine if the function can be performed.

Button Description
New Define a new variable group.
Edit Edit the variable group definition. This can be used when the variable group is in the Started or Stopped state. This is only available for a single variable group row selection.
Start Available when the variable group is in a Stopped state. Change the variable group to the Started state. The runtime Device Publisher component will read the device variables at the defined priority frequency.
Stop Available when the variable group is in the Started state. Change the data mapping to the Stopped state. The runtime Device Publisher component will stop reading the device variables at the defined priority frequency for this variable group.
Delete Available when the variable group is in the Stopped state. Delete the variable group definition from the node.
Refresh Refresh the information displayed in the Variable Groups tab. The Workbench will periodically refresh the information on its own without the Refresh button being used.

A variable group row's pop-up menu can be displayed, and the available options selected.

Related Topics

Variable Group

Data