Main Content


Read OPC UA server node attributes



Values = getNodeAttributes(UaClient,NodeList,AttributeIds) reads from the server the attributes defined by AttributeIds for the nodes identified by NodeList. You can define node objects for NodeList using getNamespace or browseNamespace.

Values = getNodeAttributes(NodeList,AttributeIds) reads from the nodes identified by NodeList. All nodes must be of the same connected client.


collapse all

This example shows how to read node attributes from the server for one layer of the namespace.

s = opcuaserverinfo('localhost');
UaClient = opcua(s);
NodeList = getNamespace(UaClient);
Values = getNodeAttributes(UaClient,NodeList,{'NodeId','Description'})
Values = 
4x1 struct array with fields:

Input Arguments

collapse all

OPC UA client, specified as an OPC UA client object

List of nodes, specified as an array of node objects. For information on node object functions and properties, type


Server attributes specified as an array of uint32, cell array of character vectors, or array of strings. For information on server AttributeId values, type


Output Arguments

collapse all

Attribute values, returned as a structure. The structure array contains the fields given by the AttributeIds. If an attribute cannot be read for a node, the relevant field will be empty.

Version History

Introduced in R2015b