Main Content

getNodeAttributes

Read OPC UA server node attributes

Description

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 functions.

values = getNodeAttributes(nodeList,attributeIds) reads from the nodes identified by nodeList. All nodes must belong to the same connected client.

example

Examples

collapse all

Read node attributes from the server for one layer of the namespace.

uaClient = opcua('opc.tcp://localhost:53530/OPCUA/SimulationServer');
connect(uaClient);
nodeList = getNamespace(uaClient);
values = getNodeAttributes(uaClient,nodeList,{'NodeId','Description'})
Values = 
4x1 struct array with fields:
    NodeId
    Description

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, see OPC UA Node.

Server attributes specified as an uint32 array, cell array of character vectors, or array of strings.

This table lists the attribute IDs available in the OPC UA Specification.

IdentifierAttributeDescription
1NodeIdNode identifier, represented as a string.
2NodeClassNode class enumeration (integer): 1 - Object, 2 - Variable, 4 - Method.
3BrowseNameName used to create browse paths, represented as a string.
4DisplayNameName of the node.
5DescriptionDescription of the node.
6WriteMask32-bit unsigned integer describing writable elements of the node.
7UserWriteMask32-bit unsigned integer describing writable elements of the node considering user access level.
8IsAbstractTrue if the node is an abstract node.
9SymmetricTrue if the node reference type is symmetric.
10InverseNameInverse name for non-symmetric reference nodes.
11ContainsNoLoopsTrue if node has no looping references in the server.
12EventNotifierTrue if client can subscribe to events on this node.
13ValueValue of node. Only defined for Variable type nodes. Empty otherwise.
14DataTypeServer data type, represented as a string.
15ValueRankServer value rank.
16ArrayDimensionsSize capability of each dimension. A value of 0 in a dimension indicates any size.
17AccessLevelTrue if the Variable node is readable and writable.
18UserAccessLevelTrue if the Variable node is readable and writable by the current user.
19MinimumSamplingIntervalSampling interval required by the server to reasonably sample the node Value for changes.
20HistorizingTrue if the server is actively collecting data for the history of the Variable node.
21ExecutableTrue if the node is executable. Only defined for Method nodes. Empty otherwise.
22UserExecutableTrue if the node is executable considering user access level. Only defined for Method nodes. Empty otherwise.

Output Arguments

collapse all

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

Version History

Introduced in R2015b