OPC-UA-Write

Use the OPC-UA-Write node to connect App Connect Enterprise applications to an OPC UA server.

Using OPC-UA-Write node in a message flow

The OPC-UA-Write node is a mid-flow node and its driven by OPC-UA-Input and OPC-UA-Read node.

The OPC-UA-Write node processes an XML message that contains the address of an OPC UA server and a list of client items and values. The OPC-UA-Write node connects to the server and writes the specified values to the client items. The incoming message must be a XMLNSC domain message.

You can use OPC-UA-Write node along with OPC-UA-Input node to write the values by using the manufacturing schemas and mapping node.

The following elements must be present in the ACMfg_WriteRequest.xsd file:
CREATE LASTCHILD OF itemsRef AS itemRef NAMESPACE wrns NAME 'Item';
SET itemRef.(XMLNSC.Attribute)wrns:path='';
SET itemRef.Data ='';
  • itemRef.(XMLNSC.Attribute)wrns:path - Specify the client item path.
  • itemRef.Data - Specify the client item value based on the data type of the source item to which the client item is mapped to.

Multiple client items can be specified, and array type client items can contain multiple values. For more information, see App Connect for Manufacturing XML schema.

If you wire the Out terminal, a message is sent from a client item that can be read. If you do not wire the Out terminal and any of the specified client items cannot be read, an exception is thrown and no message is sent from the Out terminal.

You can route or transform this data by using the nodes that are in the Toolkit palette. For example, you can publish the data with the MQTTPublish node, and then subscribe to the data with the MQTTSubsribe node.

Terminals

The OPC-UA-Write node terminals are described in the following table.
Terminal Description
Failure The output terminal to which a message is routed if an error occurs during processing.
Out The output terminal to which any successful client item readings are routed.

Properties

The following tables describe the properties for the OPC-UA-Write node.
Note: A mandatory property is marked with an asterisk and a configurable property allows you to edit when you add the message flow to the broker archive (BAR) file.

 Basic tab properties 

Table 1. Mapping the properties for the OPC-UA-Write
Field Subfields Description OP-UA-Write Mandatory Configurable
Trigger Item List (OPC-UA-Input Node) or Client Item List Triggered By The browse paths of the client items that contain the data that you want to receive. You can add and delete client items. You can discover client items from your OPC UA Server. You can add multiple client items.      
  Client Item The browse paths of the client items that contain the data that you want to receive. You can add and delete client items. You can discover client items from your OPC UA Server. You can add multiple client items. Yes Yes
  Index Range Supports reading specific index range from the Read 1D, 2D, or 3D array. Applicable for a node of array type. You can specify the index range against each client item. The specified is stored in the message flow file, then later fetched and passed in a service request made to the OPC server. You can override the index range property by using Compute node.
Note: An empty index range is not supported for 2D and 3D array for the Write node.
No Yes
DataSource Policy Name List Policy Name The policy name that is configured for a datasource.    
  DataSource UUID The DataSource UUID details.    
  DataSource Details The DataSource details, where the TCP/IP connection for the destination application, in the form of the following format.
opc.tcp://<host_name>:<port>/<UAServer_name>
Where <host_name> is the name of the host, <port> is the number of the port, and <UAServer_name> is the name of the OPC UA Server.
   

 Monitoring tab properties 

Use the Monitoring tab on the properties of a message flow node to add one or more monitoring events. An event source is a point in a message flow from which a monitoring event can be emitted. Each event source has a set of properties that control the contents of the monitoring events that it emits.

For more information, see Configuring monitoring event sources by using monitoring properties.

 Policy tab properties 
Field Description OPC-UA-Write Mandatory Configurable
Policy Project The policy project name that you want to override the datasource configuration properties at run time. You can use the user-defined policy to control the behavior of the manufacturing message flows, and the nodes in message flows, at run time. No Yes

Runtime reconfiguration

Note: The runtime reconfiguration is only applicable in a non-high availability mode.

If you have an existing client item in the Basic tab, you can add additional client items at run time using the Compute node. The "path" provided for each item in the Compute node should be unique and can be any dummy path like /xyz or /abc. Following is the format that gets added to the readFlow_Compute.esql file.

OPC-UA-Write node
SET itemRef.(XMLNSC.Attribute)wrns:sourceItemNodeId='sourceItemNodeIdvalue';
SET itemRef.(XMLNSC.Attribute)wrns:path='/anyDummyPath';
SET itemRef.Data = 'DataToBeWritten';
For a Client item that was added at node level, you do not need to specify the sourceItemNodeId value. You should specify only the value for the wrns:path parameter (Actual Client item path of the item on which the write operation is to be performed.