.NET Based OPC UA Client/Server SDK
Browse/Translate – Browse


A session with the server must be established.


The following dialog shows an example implementation of the Browse service, which can be used to read references from a node. Press the button “Show Code” to display the corresponding code, and the button “Help” to show this documentation page.


First, you have to specify some parameters to filter your results. Klick on the button “...” right of the field “Node ID” to open an adress space browser, select the desired node and confirm with “OK”. Now, the NodeId is shown at the corresponding field.


Pick a browse direction from the drop down menu.


On pressing the button “...” right of the field “Reference Type”, a browse window opens. This allows you to further restrain the results. Check the box in front of “Include Subtypes” to return subtypes of the reference type as well.


By specifiying “Max References” you can limit the maximum number of references in a single response. If specified, a continuation point is set and the method BrowseNext is called repeatedly until all references are returned. Select “0” to get all references in a single response.

After pressing the button “Browse” the reference types matching your request are shown in the table at “Browse Response”. Check the box in front of “Use Asynchronous Pattern” to call “BeginBrowse” instead of “Browse”.


Sample Code

First we need to fill the BrowseContext to specify

  • the direction, i.e. if forward, inverse, or both kinds of references are returned;
  • the reference type, i.e. references having this ReferenceType will be returned;
  • IncludeSubtypes to select whether references are returned that have a subtype of the reference type selected above
  • the maximum number of references returned in one service call.


// set up the browse filters.
BrowseContext context = new BrowseContext();
context.BrowseDirection = (BrowseDirection)BrowseDirectionCB.SelectedItem;
context.ReferenceTypeId = (NodeId)ReferenceTypeTB.Tag;
context.IncludeSubtypes = IncludeSubtypesCK.Checked;
context.MaxReferencesToReturn = (uint)MaxReferencesUD.Value;

The starting NodeId that is used for the Browse operation is provided by the GUI in standard XML format. So NodeId.Parse can be used to get the NodeId. A continuation point has to be used as out parameter.

// parse the node id.
NodeId nodeId = NodeId.Parse(NodeIdTB.Text);
// this is a blocking call so show the wait cursor.
Cursor = Cursors.WaitCursor;
byte[] continuationPoint = null;
// browse the references (setting a 10 second timeout).
List<ReferenceDescription> references = session.Browse(
new RequestSettings() { OperationTimeout = 10000 },
out continuationPoint);

There is a maximum number of ReferenceDescriptions that can be returned in a single Browse operation. If there are more reference descriptions available on the server that can be retrieved, the continuation point is not null, otherwise the continuation point is null.

This continuation point can used to get the next chunk of reference descriptions from the server. If the client is not interested in the next set of references, the continuation point has to be released.

m_continueAutomatically = context.MaxReferencesToReturn <= 0;
while (!ByteString.IsNull(continuationPoint))
if (!m_continueAutomatically)
references = session.BrowseNext(new RequestSettings() { OperationTimeout = 10000 }, ref continuationPoint);