Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

getNodeAttributes (opcua)

Read server node attributes

Syntax

Values = getNodeAttributes(UaClient,NodeList,AttributeIds)
Values = getNodeAttributes(NodeList,AttributeIds)

Description

example

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.

Examples

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);
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, type

help opc.ua.Node

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

help opc.ua.AttributeId

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.

Introduced in R2015b

Was this topic helpful?