01/12/2016
Dear OPC support Team,
I'm developing OPC client app using OPC .NET API and almost finished. When I connect my client app to the third party OPC servers using similar windows accounts on both sides (with the same username and password) everything works perfect. But, when I don't use similar accounts and want to connect using anonymous logon I get the error:
"Unable to cast COM object of type 'System.__ComObject' to interface type 'OpcRcw.Comn.IOPCServerList2'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{9DD0B56C-AD9E-43EE-8305-487F3188BF7A}' failed due to the following error: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"
I even get this error when running provided simply c# app "OpcDaSampleClient.exe". Other OPC client (such us kepware, opc expert, matrikon explorer) work perfect on the same machine with the same configurations.
In addition, both OPC client and server machines are 64 bit.
Can you please help me to figure out this problem?
Thanks in advance.
Hello,
"Access is denied" is the clue here... COM/DCOM permissions are the cause of the problem.
There are a number of DCOM configuration tutorials available online. I would suggest contacting your primary OPC Server vendor(s) for their advice on configuring DCOM to work with their OPC Servers.
01/12/2016
Thank you Nathan for your reply,
I have tried use other OPC clients to communicate with OPC server and that clients work perfect. The only clients that dos not work are my own and the one provided by OPC foundation (written in c# and using OPC .NET API, just like my client app).
Actually this is the reason, why I think that I have configured COM/DCOM correctly.
Thank you
I can understand your viewpoint. The problem is that there is more than one way to connect to an OPC Server where you can impersonate the current user, go anonymous, use specific credentials, etc. For this reason, not all Clients actually behave the same way although they might "appear" to.
"Access denied" is definitely coming from COM/DCOM.
I would suggest opening the Task Manager and looking at the processes list to see the login context of your other applications. This doesn't guarantee the client applications are using this login, but it could be a clue.
The unfortunate thing here is that DCOM troubleshooting can be difficult, time consuming, and frustrating; and with little help (information) from Windows.
01/12/2016
Thanks for provided information. The COM/DCOM settings adjustment will be done definitely as a last option.
However, I would like to do some implementations on my client to work as other clients instead of changing dcom settings now. Can you please suggest what can be done for that purposes using C#?
1 Guest(s)