http://advosol.com/manuals/opcdanet/topic891.html
Change the current browse position. Move up, down or to in the hierarchical address space. ( IOPCBrowseServerAddressSpace:: ChangeBrowsePosition )
The function will return E_FAIL if called for a FLAT space. An error is returned if the passed string does not represent a 'branch'. Moving UP from the 'root' will return E_FAIL.
Note OPC_BROWSE_TO is new for version 2.0. Clients should be prepared to handle E_INVALIDARG if they pass this to a 1.0 server.
Visual Basic (Usage)
Copy Code
Dim instance As OpcServer Dim direction As OPCBROWSEDIRECTION Dim name As String Dim value As Integer value = instance.ChangeBrowsePosition(direction, name)
C#
public int ChangeBrowsePosition( OPCBROWSEDIRECTION direction, string name )
HRESULTS
Description
S_OK
Successful Read.
E_FAIL
The call failed with an unspecific error.
E_OUTOFMEMORY
Not enough memory.
OPC_E_INVALIDARG
An argument of the call was invalid.
C#
Copy Code
Srv.ChangeBrowsePosition( OPCBROWSEDIRECTION.OPC_BROWSE_UP, "" ); // to parent Srv.ChangeBrowsePosition( OPCBROWSEDIRECTION.OPC_BROWSE_DOWN, "Device1" ); Srv.ChangeBrowsePosition( OPCBROWSEDIRECTION.OPC_BROWSE_TO, "" ); // to root Srv.ChangeBrowsePosition( OPCBROWSEDIRECTION.OPC_BROWSE_TO, "Plant3.Section5.Device2" );
Visual Basic
Copy Code
Srv.ChangeBrowsePosition( OPCBROWSEDIRECTION.OPC_BROWSE_UP, "" ) ' to parent Srv.ChangeBrowsePosition( OPCBROWSEDIRECTION.OPC_BROWSE_DOWN, "Device1" ) Srv.ChangeBrowsePosition( OPCBROWSEDIRECTION.OPC_BROWSE_TO, "" ) ' to root Srv.ChangeBrowsePosition( OPCBROWSEDIRECTION.OPC_BROWSE_TO, "Plant3.Section5.Device2" )
OPC DA Server Version: V2