OPC UA: Read Node

The OPC UA: Read Node allows you to read multiple node values from your OPC UA Server and connected programmable logic controller (PLC). This node is only available in Edge Workflows.

OPC UA Read Node

Node Properties

There are four main parts of the properties for this node …

Connection Configuration

OPC UA Read Node Configuration

Connection Configuration contains:

  • OPC UA URI (Required): A string template for the OPC UA server URI.
  • Username (Optional): A string template for login username.
  • Password (Optional): A string template for login password.

Security Settings

You can optionally select a SSL/TLS Security Policy for the connection to the OPC UA server through the dropdown selector. Security Policy options include:

  • None
  • Basic-128
  • Basic-128 RSA-15
  • Basic-192
  • Basic-192 RSA-15
  • Basic-256
  • Basic-256 SHA-256

OPC UA Read Node SSL/TLS Security

If a Security Policy is selected, you will have the option to select between “Sign” or “Sign and Encrypt” security modes. You’ll then be required to provide a valid SSL/TLS client certificate and private key.

Read Instructions

OPC UA Read Node Read Instructions

Read Instructions can be specified in one of two ways. At least one is required, but both can’t be specified at the same time.

  • Array of Template Strings: For each Read Instruction, fill out the following input configuration fields, all of which can utilize templates. You must define at least one instruction:

    • Namespace Index (ns) (Required): A string template or positive integer.
    • Identifier (Required): A string template or string for the node identifier. The identifier string should begin with one of the following types:
    • i=: for unsigned integer (UINT).
    • s=: for string.
    • g=: for global unique identifier (GUID).
    • b=: for byte string.
    • Result Key (Required): The key at which to store the result of this read operation. This key will exist on the Destination Path defined below the instructions. This can resolve to any string except errors, since that key is reserved for any errors that occur during reads.
  • Payload Path: (edge version 1.18.0 and above) Enter a payload path that resolves to an array of Read Instructions to be run on this node. The following are the object properties that each object in the array should contain for successful attempts:

    • nameSpace: (Required) A string or positive integer.
    • identifier: (Required) A string for the node identifier. The identifier string should begin with one of the following types:
    • i=: for unsigned integer (UINT).
    • s=: for string.
    • g=: for global unique identifier (GUID).
    • b=: for byte string.
    • key (Required): The key at which to store the result of this read operation. This key will exist on the Destination Path defined below the instructions. This can resolve to any string except errors, since that key is reserved for any errors that occur during reads.

The following is an example of an array that you could pass in:

[
  {
    "nameSpace": 2,
    "identifier": "i=3",
    "key": "Power"
  }
]

Destination Path

OPC UA Read Node Result

The results of each read instruction will be placed in an object at the Destination Path (a payload path) at each instruction’s Result Key. It is important that each key is named uniquely so the node does not overwrite another read result.

If the key is not present in the Destination Path of the payload, it means the read failed, and there will be a list of errors at the Destination Path under the key errors. For this reason, this node restricts Result Keys to not resolve to the path errors. Because the tags are read as a group one failed read for a tag may cause the other keys in the group to not appear.

Result

The following is an example of a successful read, where an instruction’s Result Key is Power, and the Destination Path is OPCUA_PLC:

{
  "OPCUA_PLC": {
    "Power": 10.01
  }
}

Node Errors

The following is an example of a failure to read, and the destination path is OPCUA_PLC:

{
  "OPCUA_PLC": {
    "errors": [
      {
        "type": "OPC-UA_READ_ERROR",
        "message": "Something useful to help you fix the issue."
      }
    ]
  }
}

Was this page helpful?


Still looking for help? You can also search the Losant Forums or submit your question there.