Unable to cast COM object of type 'System.__ComObject' to interface type 'OpcRcw.Comn.IOPCServerList2'|Classic OPC: DA, A&E, HDA, XML-DA, etc.|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Unable to cast COM object of type 'System.__ComObject' to interface type 'OpcRcw.Comn.IOPCServerList2'
Avatar
Ivan Kucheryavykh
Member
Members
Forum Posts: 3
Member Since:
01/12/2016
sp_UserOfflineSmall Offline
1
04/01/2016 - 07:52
sp_Permalink sp_Print

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.

Avatar
Guest
Guests
2
04/01/2016 - 07:56
sp_Permalink sp_Print

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.

Avatar
Ivan Kucheryavykh
Member
Members
Forum Posts: 3
Member Since:
01/12/2016
sp_UserOfflineSmall Offline
3
04/01/2016 - 08:03
sp_Permalink sp_Print

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

Avatar
Guest
Guests
4
04/01/2016 - 08:33
sp_Permalink sp_Print

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.

Avatar
Ivan Kucheryavykh
Member
Members
Forum Posts: 3
Member Since:
01/12/2016
sp_UserOfflineSmall Offline
5
04/01/2016 - 09:48
sp_Permalink sp_Print

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#?

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 27
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1347
Posts: 4567