Click here to Skip to main content
15,942,847 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How brows Items from OPC - DA after connecting from Opc.Da clients?
I have this listing to browse the root elements of my Opc.Da server:

C#
            string _hostName = "localhost";
            string _serverName = "OPC.SimaticNET";
            string urlstring = string.Format("opcda://{0}/{1}", _hostName, _serverName);
            Server s = new Server(new Factory(), new URL(urlstring));
            s.Connect();
            ItemIdentifier itemId = null;
            BrowseFilters filters = new BrowseFilters() { BrowseFilter = browseFilter.branch };

//Here I also use {BrowseFilter = browseFilter.item}
//but in that time value of  elements=null
            BrowsePosition position = new BrowsePosition(itemId, filters);
           
            BrowseElement[] elements= s.Browse(itemId, filters, out position);


how do I browse the children of each element ? Means how do I browse the item of each element?

pls give me some solutions!!
Posted
Updated 3-Apr-13 18:30pm
v2

1 solution

I know the post is old but for the sake of others.
pseudo code is as follows:
for each element in elements
BrowseElement[] children = s.Browse(element.itemId, filters, out position);


You will need to set your filters to look for items or branches of the element.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900