System Variable Get

A system variable contains runtime information about the node. The Workbench provides a view to these internal variables via the Administration feature and the System Variables tab.

When troubleshooting an issue, you might be asked to record the values of specific system variables. You can also use the System Variable Get action to obtain the value of these internal variables. You can use any trigger variable including static, local, and device variables.

Adding a System Variable Get action

The System Variable Get action is available from the Trigger window.

  1. From the Actions tab, click Add .

    The New Action window appears.
  2. Expand Internal, select System Variable Get, and then click Add.
    The right pane changes to accommodate a System Variable Get action.

Parameter descriptions

Parameter Description
Use Pre-defined Variable Options are:
  • True — Provides a list of pre-defined system variables in the System Variable parameter.
  • False — Provides a single system variable name that you can change.
System Variable The name of the system variable whose value you want to get.
  • When you select True from the Use Pre-defined Variable option, a list of system variables that match the internal variables available from the System Variables tab appears. When you select a variable from this list, its corresponding data type appears under the Logical column on the Output tab .
  • When you select False from the Use Pre-defined Variable option, the name of a single internal variable appears. You change the name of the variable. When the name is changed or a new name is specified, the data type under the Logical column changes to ANY. This means the data type of the variable can be any type.

Output tab

The Output tab is used to store the value of a system variable.

Parameter Description
Name This row is used to identify the name of the variable to place the result of the action. The name will change based on the system variable selected.
Logical The column specifies the data type for the variable. Depending on the system variable selected, the result could be an INT4, INT8 or a String. For a variable selected using the False option, the result will be ANY.
Value The variable where the value of the system variable is returned. You can select from a list of device variables, or a user defined local or static variable.
Type When you specify Value, the data type of variable is automatically added to the Type column.

For more information about system variables, see System Variables.

Obtaining the data values for the system variable

You can create a trigger and then set the reporting option to on to obtain the input and output data values of the System Variable Get action in a report. You can export the report as a file to your local computer.
The following assumes that you have created a trigger and set the Reporting option to On.

For this example, an On-Demand trigger type is specified and the LocVar local variable was created. This local variable is where the value of the system variable will be returned. You have also added a System Variable Get action similar to the following:

Once the trigger is saved, follow these steps to obtain the input and output values for the system variable:

  1. From the project tab, start the appropriate trigger.

  2. When the state of the trigger is Started, right-click to display its pop-up, and then slick Fire Trigger.
    The Successes column will be incremented by one. The next step is to view the report that was generated when the trigger executed.
  3. From the Workbench left pane, expand Logs & Reports, and then click Reports.
    The Reports tab appears.

  4. Select the appropriate report. For this example, AcmeProductsSysVarGet trigger.
    Information about the trigger appears on the lower portion of the Reports tab.

  5. Expand the System Variable Get category to view the report.
    The next step is to export the report so that you have a record.

  6. From the Reports tab, select the report you want to export, right-click to display its pop-up menu, select Export, and then select Selected (the report will contain information for the project and trigger on the selected row).
    The Export File Location window appears.
  7. From the Look in box, change to the location you want to export the report to, and then click Open.
    The export location is added to the Look in box.
  8. In the File Name box, enter a name for the report.
  9. Select Export.
  10. A message appears telling you the report was successfully export. Select OK.

The report is saved with a .txt extension. You can open the report with any text editor.