Address Space Browsing¶
Address space browsing is done with the ‘browse’ method. Both the client and server have this method.
The browse method accepts three parameter types:
String with node ID
Array of strings with Node ID
Table with detailed parameters
These parameters are described in section browseParameters.
Method browse returns browseResult
Browsing by String NodeID¶
To browse a single node, you need to pass a string with node ID into the browse Method:
-- Browse one node by ID.
resp, err = client:browse(RootFolder)
To browse several nodes at once, you can pass an array of nodeIDs as follows:
-- Browse array of Node IDs.
resp, err = client:browse({RootFolder, TypesFolder})
Browsing a node by ID sends a request to the server with the following parameters:
Follow Hierarchical references in forward direction
Node class mask - All node classes
Result mask - all attributes
Detailed Parameters¶
For special cases, you can manually set the browse parameters as shown in the following example:
local browseParams = {
requestedMaxReferencesPerNode = 0,
nodesToBrowse = {
{
nodeId = RootFolder,
referenceTypeId = HierarchicalReferences,
browseDirection = ua.Types.BrowseDirection.Forward,
nodeClassMask = ua.Types.NodeClass.Unspecified,
resultMask = ua.Types.BrowseResultMask.All,
includeSubtypes = 1,
},
{
nodeId = RootFolder,
referenceTypeId = HierarchicalReferences,
browseDirection = ua.Types.BrowseDirection.Forward,
nodeClassMask = ua.Types.NodeClass.Unspecified,
resultMask = ua.Types.BrowseResultMask.All,
includeSubtypes = 1,
}
},
}
local resp,err = client:browse(browseParams)