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.

getNamespace (opcua)

Namespace of server associated with client

Syntax

nodes = getNamespace(UaClient)
nodes = getNamespace(UaClient,BrowseNode)
nodes = getNamespace(___,'-force')

Description

example

nodes = getNamespace(UaClient) retrieves one layer of the namespace of the server associated with client object UaClient. The namespace is stored in the Namespace property of uaClient as a hierarchical tree of nodes.

nodes = getNamespace(UaClient,BrowseNode) retrieves only the nodes referenced from BrowseNode, and stores them in the Children property of BrowseNode. If the BrowseNode argument is empty or omitted, the first layer of the namespace is retrieved and stored in the client.

getNamespace might not need to retrieve nodes from the server. If the nodes already exist locally, they are returned automatically.

nodes = getNamespace(___,'-force') forces retrieval of the Children property contents from the server again and stores them in BrowseNode, even if the nodes already exist locally.

Examples

collapse all

This example shows how to retrieve one layer of the namespace from the OPC UA client.

s = opcuaserverinfo('localhost');
UaClient = opcua(s);
connect(UaClient);
nodes = getNamespace(UaClient)
nodes = 
1x4 OPC UA Node array:
    index      Name       NsInd  Identifier  NodeType  Children
    -----  -------------  -----  ----------  --------  --------
      1    Server         0      2253        Object    10
      2    Data           2      10157       Object    3
      3    Boilers        4      1240        Object    2
      4    MemoryBuffers  7      1025        Object    2

Input Arguments

collapse all

OPC UA client, specified as an OPC UA client object

Browse node, specified as a node object.

Output Arguments

collapse all

Layer of namespace tree from server, returned as a structure.

Introduced in R2015b

Was this topic helpful?