Main Content

isEmptyNode

True for empty nodes of OPC UA node array

Description

emptyNode = isEmptyNode(nodeObj) returns true (logical 1) for nodes that are empty, or false (logical 0) otherwise. A node is empty if its NamespaceIndex or Identifier property is empty. You cannot use an empty node in any read, write, or query operation on a connected client.

example

Examples

collapse all

Identify which nodes in an array are empty.

Browse the namespace to select nodes. This example selects two.

s = opcuaserverinfo("localhost");
uaClient = opcua(s);
connect(uaClient);
nodes = browseNamespace(uaClient)
nodes = 

1x2 OPC UA Node array:
    index   Name   NsInd  Identifier  NodeType  Children
    -----  ------  -----  ----------  --------  --------
      1    FTX001  4      1243        Object    1
      2    Output  4      1244        Variable  1

You can create an array of nodes that contains results from separate browsing results. Assign the latest nodes to this array, and verify which nodes are empty.

nodeArray(3:4) = nodes;
emptyNode = isEmptyNode(nodeArray)
emptyNode =

  1x4 logical array

   1   1   0   0

The result indicates that elements 1 and 2 are empty nodes.

Input Arguments

collapse all

OPC UA nodes, specified as an array of node objects.

Example: nodeObj = opcuanode()

Output Arguments

collapse all

Indication that node is empty, returned as a logical value or array of logical values. A value of true (1) indicates an empty node.

Version History

Introduced in R2016b