Main Content

browseNamespace

Graphically browse namespace and select nodes from OPC UA server

Description

nodeList = browseNamespace(uaClient) opens the Browse Namespace dialog box for the OPC UA client specified in uaClient. Using this browser, you can construct a list of nodes, and return an array of those nodes in nodeList. You can use nodeList to retrieve data for those items using read, readHistory, readProcessed, readAtTime, or readModified functions.

The function retrieves the namespace from the server incrementally. uaClient must be connected when you call this function.

example

nodeList = browseNamespace(uaClient,nodes) specifies an initial list of Nodes to supplement in the namespace browser. When you click Cancel in the namespace browser, the nodeList returned is empty.

example

Examples

collapse all

Query the host for installed OPC UA servers and connect a client to the server. Use the browseNamespace function to open the Browse Namespace dialog box.

s = opcuaserverinfo('localhost');
uaClient = opcua(s);
connect(uaClient);
nodeList1 = browseNamespace(uaClient)

Select the required nodes and click Add Node to move the nodes into the Selected Nodes section. Click Add Child Nodes to select all the child nodes of a selected node. Use Remove Node to remove a node from the Selected Nodes section. After you add the nodes you want in the Selected Nodes section, click OK.

Namespace Browser

Query the host for installed OPC UA servers and connect a client to the server. Use the browseNamespace function to open the Browse Namespace dialog box.

s = opcuaserverinfo('localhost');
uaClient = opcua(s);
connect(uaClient);
nodeList1 = browseNamespace(uaClient)

In the Browse Namespace dialog box, select three nodes from the Namespace section and add them to the Selected Nodes section.

Namespace Browser

NodeList1 = 

1x3 OPC UA Node array:
    index    Name    NsInd  Identifier  NodeType
    -----  --------  -----  ----------  --------
      1    Constant  3      1001        Variable
      2    Random    3      1003        Variable
      3    Sinusoid  3      1005        Variable
nodeList2 = browseNamespace(uaClient,nodeList1)

The Browse Namespace dialog box opens with the nodes in nodeList1 already listed in the Selected Nodes section.

Namespace Browser

After you add the required nodes to the selected nodes section, click OK. The updated nodeList2 would include the nodes supplemented from nodeList1 and the newly added nodes.

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.

Output Arguments

collapse all

List of nodes, returned as an array of node objects. For information on node object functions and properties, see OPC UA Node.

Version History

Introduced in R2015b

expand all