How to map variables to OPC UA elements

In PcVue, OPC UA server variables can be linked to existing variables in the project or can be added as new variables. This linking process can be carried out from the server mapping dialog.

You can also map variables via the source tab of the variables configuration dialog. Refer to the topic Linking variables to an OPC UA server to learn more.

Prerequisites:

Mapping variables

  1. Go to Configure.Application Explorer and expand Communication then Data acquisition nodes.

  2. Expand the OPC UA node, then click Networks. The OPC UA networks configured appears on the right pane.

  3. Select the network you want to map variables to, then click Mapping button on the toolbar. The Mapping dialog appears. ClosedShow picture

  4. Select the appropriate server and expand it to find the item you wish to map. The variables appear in the content pane of the mapping dialog.

  5. Right-click the variable and select whether to map a new variable or to link the OPC UA element to an existing variable.

    (map new variable selection) Click Map new variable, define a variable name and monitoring parameters in the creation dialog. Once created, the new variable can be found in the Variables tree. ClosedShow picture

    (Map existing variable selection) Click Map existing variable and select the variable you wish to map to, then click Apply. A pop-up might appear warning you that the variable you are trying to map to is not an OPC UA variable, you can click Yes to dismiss it. ClosedShow picture

    You can check the mapping by right-clicking on the variable in the OPC UA mapping dialog and selecting Variable properties, then the Source tab.

    Unmapping variables

    1. On the OPC UA node, select the network for which you want to unmap variables from, then click Mapping in the left pane.

    2. Go to the mapped variable you want to unmap, and right-click on it, then click Unmap variable.

Using the OPC UA helper to call a method

The OPC UA helper allows you to send call method requests to a server with specified input arguments. Calling a method from the OPC UA helper is designed to be used for testing while configuring the project. You can use the SCADA Basic instruction OPCUA mode METHOD to call OPC UA methods at runtime.

From the OPC UA mapping dialog, right-click a node class of type method identified by this icon then select Call. The OPC UA helper dialog appears. ClosedShow picture

Once opened, the OPC UA helper dialog displays a list view of all browsed input arguments along with their name and a property grid in the right panel showing details per category:

  • General category shows basic details like input's name and description.

  • Type category shows data type details like name and definition type of the data (Simple, enumeration, structure, optionSet). The field Data type displays the BrowseName of the data type referenced by the NodeId or the default name for Built-in types.

  • Value category shows all fields required according to the structure of the input's value. Value checking is applied in each field according to the data type required.

To send a call, click on the Call method button in the helper toolbar. The status bar at the bottom of the dialog shows details about the operation status (success or failure).

You can copy all input arguments by clicking the Copy to clipboard button in the helper main toolbar. You can also copy selected input arguments only by clicking the Copy to clipboard in the Operation pane toolbar. The input arguments are put in the clipboard as a Json-formatted string.