We are doing some testing with ICONICS's SimulatorOPCDA OPC Server. We have used this server with other products with no issues. The module that I am writing needs to collect certain tags from the entire AddressSpace.
The client.BrowseNodes() function seems to only return tags for the current location in the AddressSpace (and not any tags in branches from the current AddressSpace location). Obviously one could recurse the AddressSpace by repeating the BrowseNodes() for each branch but the BrowseNodes() method can take a NodeFilter which, among other settings, allows the use of DABrowseFilter.Flat.
According to the documentation this option "Return leaves only, flattening the address space into a non-hierarchical list.". This seems to imply that by using the DABrowseFilter.Flat one should be able to get all Leaves in a single browse.
To test this, I built some very simple code:
EasyDAClient opc = new EasyDAClient();
DANodeFilter nodeFilter = new DANodeFilter(DABrowseFilter.Flat, "", "", OpcLabs.EasyOpc.VarType.Empty);
DANodeElementCollection nodeElementCollection = opc.BrowseNodes("127.0.0.1", "ICONICS.SimulatorOPCDA.2", "", nodeFilter);
foreach(DANodeElement element in nodeElementCollection)
{
System.Console.WriteLine("Tag: "+element.Name + " (" + element.BrowsePath + ")");
}
When I try the above code, it does not return any results. When I change the NodeFilter to DABrowseFilter.Any or DABrowseFilter.Leaves then I get results.
Can some explain to me what I am doing wrong?