OPC .NET API 2.1.106.0 exception on remote DCOM OpcRcw.Comn.IConnectionPoint.Advise(Object pUnkSink, Int32& pdwCookie)|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
OPC .NET API 2.1.106.0 exception on remote DCOM OpcRcw.Comn.IConnectionPoint.Advise(Object pUnkSink, Int32& pdwCookie)
Avatar
Christiaan Vancraeyenest
Member
Members
Forum Posts: 5
Member Since:
12/14/2016
sp_UserOfflineSmall Offline
1
12/19/2016 - 06:19
sp_Permalink sp_Print

Exception caught. System.Runtime.InteropServices.COMException (0x80040202): Exception from HRESULT: 0x80040202
   at OpcRcw.Comn.IConnectionPoint.Advise(Object pUnkSink, Int32& pdwCookie)
   at OpcCom.ConnectionPoint.Advise(Object callback)
   at OpcCom.Da.Subscription.Advise()
   at OpcCom.Da.Subscription.add_DataChanged(DataChangedEventHandler value)
   at Opc.Da.Subscription.add_DataChanged(DataChangedEventHandler value)

Only when using a none local opc server this exception happens!

When working with an OPC client not based on OPC.NET.API all is working fine, so I assume this is not a DCOM setting problem.

any ideas anyone?

Avatar
Peter Pombo
Member
Members
Forum Posts: 3
Member Since:
10/05/2016
sp_UserOfflineSmall Offline
2
03/07/2017 - 11:49
sp_Permalink sp_Print

I am having the same issue. Did you ever resolve the problem?

Thanks.

Avatar
Randy Armstrong (Sparhawk)
Member
Members
Forum Posts: 20
Member Since:
05/12/2015
sp_UserOfflineSmall Offline
3
03/08/2017 - 13:58
sp_Permalink sp_Print

DCOM permission problems can show up on local host if you are using Windows Services.

Avatar
Christiaan Vancraeyenest
Member
Members
Forum Posts: 5
Member Since:
12/14/2016
sp_UserOfflineSmall Offline
4
03/09/2017 - 04:16
sp_Permalink sp_Print

I have tested this as an application and as a service with same setup (.net and none .net).

In both cases only app/service based on .net lib give this error

Avatar
Guest
Guests
5
03/09/2017 - 06:41
sp_Permalink sp_Print

Which “account” is your service running under? (“system” or other?)

Next, is that account specified within the DCOM configuration screens?

Does your application exist within the list of applications (within the DCOM configuration) and if so, did you configure it?

DCOM is always a pain and a constant cause of frustration, but we will get there!

Avatar
Peter Pombo
Member
Members
Forum Posts: 3
Member Since:
10/05/2016
sp_UserOfflineSmall Offline
6
03/09/2017 - 06:44
sp_Permalink sp_Print

My configuration is somewhat different. I have written a web application that uses the opcnetapi component. Debugging it in Visual Studio works fine when the application is hosted on IIS Express. When hosted on full IIS it fails with the same error you are seeing above. Permissions are not a problem since I have set both versions of IIS to run as the same user with administrative privileges. I am connecting to two remote OPC servers successfully when hosted on IIS Express.

Avatar
Christiaan Vancraeyenest
Member
Members
Forum Posts: 5
Member Since:
12/14/2016
sp_UserOfflineSmall Offline
7
03/09/2017 - 07:04
sp_Permalink sp_Print

I use a dedicated user for OPC, service & app use same user account.
I would assume DCOM is ok, as problem only pops up when you activate (Advise) the groups (call backs)
Also was working in the past with previous version of .NET API lib on same systems

Avatar
Guest
Guests
8
03/13/2017 - 00:07
sp_Permalink sp_Print

When you do an Advise, DCOM creates separate connections from the Server to the Client. For that scenario, the DCOM security settings on the Client node will be checked. I.e. a working connection between Client and Server does not imply that callbacks work.

The OPC Foundation created a DCOM configuration whitepaper for Interop Testing workshops which I will send you by eMail.

Avatar
Christiaan Vancraeyenest
Member
Members
Forum Posts: 5
Member Since:
12/14/2016
sp_UserOfflineSmall Offline
9
03/13/2017 - 02:24
sp_Permalink sp_Print

Thanks Karl for the mail, but this is a know document for me.

But just to be sure I rechecked the Dcom settings and they are ok and Firewalls are disabled.

Did reboot of systems and test but still same error

just a reminder:

– I have none dotNet clients working fine on same systems with out problems

– only after the upgrade of the .Net API (installed was include with other software) I see this problem.

Avatar
Peter Pombo
Member
Members
Forum Posts: 3
Member Since:
10/05/2016
sp_UserOfflineSmall Offline
10
03/13/2017 - 04:14
sp_Permalink sp_Print

Karl,

Can you email me a copy of the whitepaper? This may help me debug my problem.

Thanks.

Avatar
Guest
Guests
11
03/14/2017 - 00:10
sp_Permalink sp_Print

Hi Peter,

it should be in your mailbox.

Regards, Karl

Avatar
Christiaan Vancraeyenest
Member
Members
Forum Posts: 5
Member Since:
12/14/2016
sp_UserOfflineSmall Offline
12
03/30/2017 - 01:47
sp_Permalink sp_Print

ConfusedDo we know if some developer is looking in to this problem?

Avatar
Sean Brennan
New Member
Members
Forum Posts: 1
Member Since:
06/04/2019
sp_UserOfflineSmall Offline
13
09/20/2019 - 11:25
sp_Permalink sp_Print

I had this problem also and it drove me nuts for 2 weeks!

After cleaning up DCOM security access rights, I was able to connect to remote OPC server and I could even create the Subscription.

But when I tried to create the event handler for the DataChanged event on the subscription, I would always get the error described in post 1 of this thread.

Check Windows Event Viewer \ Windows Logs \ Security on the server machine.

If you are able to connect, you should see Audit Success messages when your client connects.

Now, look at that same log on the CLIENT.  When you try to create the callback / event handler, the library is attempting to do that in the security context of the remote OPC Server.  Mine was set to run as the SYSTEM account on my server, and I was getting Audit Failure messages on my client when trying to create the event handler.  Looking into the event log, it was attempting a logon as SYSTEM.

My guess is that the SYSTEM account passwords on the 2 systems do not match and I do not know how to change that.

Solution was to create a local account on each machine for running the OPC Server which runs as a service.  I used that security context for my OPC server connection from the client (credentials within the ConnectData object used for Server.Connect).  This account is also configured for all the DCOM security stuff as found in numerous articles on the web.  Of course, the Username and Password for these new accounts on each machine must match.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online: Randy Armstrong
Guest(s) 40
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1445
Posts: 4888