This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

getNamespace (opcua)

Namespace of server associated with client


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



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.


collapse all

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

s = opcuaserverinfo('localhost');
UaClient = opcua(s);
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.

See Also


Introduced in R2015b