Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

BrowseServers

More
29 Apr 2014 08:20 #1907 by SW
Replied by SW on topic BrowseServers
private void Test_BrowseServers(string serverName)
{
EasyDAClient client = new EasyDAClient();
try
{
foreach (OpcLabs.EasyOpc.ServerElement se in client.BrowseServers(serverName))
{
System.Diagnostics.Debug.Print("{0}", se.Description);
}
}
catch { System.Diagnostics.Debug.Print(":("); }
}

if I use an EasyAEClient I get a value returned, but the DA one just never returns. Debugger is set to break on any thrown exception. (Have tried IP address and machineName)
Thanks

Please Log in or Create an account to join the conversation.

More
29 Apr 2014 07:33 #1906 by support
Replied by support on topic BrowseServers
This is weird. Are you absolutely sure that the execution does not return from the BrowseServers call, e.g. cannot there be an unhandled exception that takes the control somewhere else?

Can you please post here the piece of code relevant to your BrowseServers call, including error handling?

Also, sometimes there are first-chance exceptions that are of interest - don't they appear in the debugger Output window, or can you set the debugger option to break immediately when any exception is thrown?

Thank you

Please Log in or Create an account to join the conversation.

More
28 Apr 2014 08:11 #1901 by SW
Replied by SW on topic BrowseServers
1 Windows service/app
2 easyDAClient1.ReadItem throws{System.UnauthorizedAccessException: Access is denied. }
3 For browsing I have tried the following to list the opc DA servers on the remote machine

This fails
Guid CLSID_OPCEnum = typeof(OpcRcw.Comn.IOPCEnumGUID).GUID ;
Type typeFromCLSID = Type.GetTypeFromCLSID(CLSID_OPCEnum, ipAddress,true);
iServerList = (OpcRcw.Comn.IOPCServerList2)Activator.CreateInstance(typeFromCLSID);


This works
typeFromCLSID = Type.GetTypeFromCLSIDnew Guid("{13486D51-4821-11D2-A494-3CB306C10000}"), ipAddressOrMachineName);
iServerList = (OpcRcw.Comn.IOPCServerList2)Activator.CreateInstance(typeFromCLSID);

This works
OpcRcw.ServerEnumerator se = new OpcRcw.ServerEnumerator();
se.Connect(ipAddressOrMachineName, "", "", "");
foreach (OpcRcw.ServerDescription d in se.GetAvailableServers(new Guid[] { typeof(CATID_OPCDAServer10).GUID, typeof(CATID_OPCDAServer20).GUID, typeof(CATID_OPCDAServer30).GUID }))
{
System.Diagnostics.Debug.Print("{0} ClassId:{1} ProgId{2} {3}",d.Description ,d.Clsid,d.ProgId,d.GetType().Name);
}
se.Disconnect();

Thanks

Please Log in or Create an account to join the conversation.

More
27 Apr 2014 08:08 - 27 Apr 2014 08:08 #1900 by support
Replied by support on topic BrowseServers
Hello, can you please provide following more info:
  1. What kind of project are you making (e.g. desktop app, Web app, Web service, Windows service, ...)?
  2. How do other kinds of operations behave (ReadXXXX, WriteXXXX)?
  3. Have you tried other OPC client from the same computer, and what were the results?

Thank you
Last edit: 27 Apr 2014 08:08 by support.

Please Log in or Create an account to join the conversation.

More
25 Apr 2014 07:53 #1894 by SW
Replied by SW on topic BrowseServers
No... it just does not return... left it for >10mins

Please Log in or Create an account to join the conversation.

More
25 Apr 2014 07:25 #1893 by support
Replied by support on topic BrowseServers
Hello.

The current code in the BrowseServers is less resilient against hangs than that for data operations, such as ReadXXXX or WriteXXXX. It does not run the actual browsing method on a separate thread and thus it cannot enforce its own timeout on top of it.

From what you describe, the call might be blocked inside the DCOM. How long have you waited? What happens if you wait more than 6 minutes - does it return then?

Thank you

Please Log in or Create an account to join the conversation.

More
25 Apr 2014 07:02 #1892 by SW
BrowseServers was created by SW
When calling EasyDAClient BrowseServers(machineName)onto a remote machine, the call is made but never returns causing application to hang.
DCOM is not set up so I would expect the function call to return / throw an exception rather than hang. However OPCEnum service is running on the remote machine.

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.054 seconds