Expressions in the Data Browser

Expressions are combinations of data sources, numbers, operators, grouping symbols (such as brackets and parentheses) arranged in a meaningful way which can be evaluated. During runtime mode, OPC servers resolve the data source for the expression and the expression is evaluated. There are two types of Expressions available in the GENESIS64 , and both are described in this topic: local and global.

Local Expressions

Some applications like GraphWorX64 support built-in local expressions, which can be defined locally using the Data Browser's Expressions tab. An example of a local expression in the Unified Data Browser is shown below. A detailed description of this tab is provided in Expression Editor, along with ways to write effective expressions.

 

A Local Expression in the Data Browser

Global Expressions

In addition, GENESIS64 provides Global Expressions. They are defined centrally in the Workbench in the Unified Data Manager and available as normal OPC tags in OPC UA client applications. A global expression allows combining of miscellaneous data tags in a simple expression. Each global expression is implemented as a single expression data tag. Its re-calculation will be based on input values or on trigger data tags. Client applications can access these expression data tags as read/write data tags with a configured data type.

 

Once a global expression is defined in the Unified Data Manager , it can be used in OPC UA client applications. To use an expression, you open the Data Browser and browse the OPC UA tab, then OPC Servers, then My Server, then Global Expressions, and then choose the desired folder or global expression. As you navigate to the expression, the path to the expression is shown in the navigation toolbar as a bread crumb, as shown in the figure below. When you click on the navigation toolbar, the path switches to the standard UNC format.

 

Global Expressions in the Data Browser

The navigation bar and bread crumbs are shown circled in red.

 

Creating a Global Expression

Global expressions are organized in a tree structure of folders and expression items. Features of global expressions include:

To Create a Global Expression:

  1. Start the Workbench and open the Unified Data Manager .

  2. In the Unified Data Manager, right-click the Expressions node in the navigation tree and select Expression, as shown in the figure below.

The New Expression Command in the Data Manager

  1. Enter a name in the Name text box for the Global Expression form.

  2. On the Expression Properties tab, specify the data type, default scan rate, and parameters if any. This tab is described in detail below, in Expression Properties Tab.

  3. Click the Read Expression tab and enter the expression definition. Then, if you intend to write values, click on the Write Expression tab and enter the expression for the WRITE operation. The essential actions of an expression are contained in the these two tabs. They are described in detail below in Read Expression Tab and Write Expression Tab.  

  4. When you are done, click the Apply button.

Note. Some expressions have READ definitions, and others may have both READ and WRITE.

 

A Sample READ Expression

Folders

Global expressions can be logically organized inside Unified Data Manager in folders. Each folder appears as a node in the navigation tree. Some folders may already be defined, such as the SubExpressions and Units folders. You can add a folder to the Expressions node or to any existing folder.

To Create a New Folder:

  1. In the Unified Data Manager, right-click the node in the navigation tree and select Folder. A new folder (with the name New Folder) appears in the tree control and the Folder form appears.

  2. In the Name field, type a name for the new folder.

Expression Properties Tab

The Expression Properties tab allows you to configure the following settings:

Parameters

Each data tag may support parameters that could modify names of the data tags. Each parameter can be integer or string data type with optional formatting. The table below shows possible formatting for each supported data type.

Data Types

Data Type

Formatting

Integer (number)

Minimum number of digits used for character representation of an integer number and padded character.

String

Minimum number of characters and padding characters plus padding direction (add padding characters from left or right side).

The client application passes configured parameter values as a part of the full data tag name. Parameters are client driven, and they do not change the number of requested data tags in runtime. Parameters can be integer or string values. These values are then formatted using pre configured format data, and then they replace specific parts of a data tag name by values passed in the data tag name. Parameters are delimited by double carets (i.e., << and >>) and specified by their names in the tag name, as shown below:

ICONICS .Simulator.1\SimulatePLC\Ramp<<Parameter1>>) in the data tag name.

Read Expressions Tab

A READ expression must be compliant with the ICONICS expression syntax. In runtime, it is processed by the standard ICONICS expression engine. The expression can be recalculated and triggered in two basic ways:

In the Read Expression tab, configure the following settings:

Write Expressions Tab

An expression can be defined to WRITE new values, but expression must be compliant with GENESIS64 's expression syntax. The three rules you need to follow are:

  1. WRITE expressions allow one output data tag.

  2. They can use as inputs the written value and any number of other input data tags.

The Write Expression tab has the following settings:

See also:

Unified Data Browser

Global Expressions