![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/userdefault.png)
03/19/2024
![sp_UserOfflineSmall](https://opcfoundation.org/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_UserOfflineSmall.png)
I have a Windows Service with .NET Framework 4.8 which connects to an OPC-DA server (Wonderware OI.GATEWAY). I have installed the latest Nuget packages for OpcNetApi, OpcNetApi.Com, and OpcNetApi.Xml.
I'm able to connect to the Opc.Da.Server just fine and read an ItemValueResult.Value returned from a simple test ItemIdentifier.
The following exception is thrown when I attempt to register a delete event handler method on DataChanged (line of code which causese the exception to be thrown shown first). My goal is to subscribe to a list of tags and fire a delegate method on DataChanged.
group.DataChanged += new Opc.Da.DataChangedEventHandler(onDataChange);
System.Runtime.InteropServices.COMException: 'The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)'
This exception was originally thrown at this call stack:
OpcCom.ConnectionPoint.Advise(object)
OpcCom.Da.Subscription.Advise()
OpcCom.Da.Subscription.DataChanged.add(Opc.Da.DataChangedEventHandler)
Opc.Da.Subscription.DataChanged.add(Opc.Da.DataChangedEventHandler)
HistorianDataForwarder.Services.OPCDAService.AddSubscription(string, System.Collections.Generic.List<string>, HistorianDataForwarder.Services.OPCDAService.DataChangedEventHandler) in OPCDAService.cs
HistorianDataForwarder.ForwarderService.ConnectOPC() in ForwarderService.cs
I'd appreciate any help, thanks!
1 Guest(s)