In adittion:
Code below does nothing, just creating an object.
private void _subs_ValuesChanged(object sender, OaSubscriptionMultiValueChangedEventArgs args)
{
var _arr = (IList<OaDpValueItem>)args.Values;
TagResult res = new TagResult
{
Name = _arr[0].DpName,
Value = toNetValue(_arr[0].DpValue),
Timestamp = _arr[1].DpValue
};
}
Sometimes it crushes when I broke network connection, and restore it.
My subscribtion containts only remote system DP's (WinCC OA 3.15\3.14).
Local system runs on WinCC OA 3.16 P15
Also I checked this code on local DP's subscriptions, and it works fine.
Exceptions :
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
at ETM.WCCOA.Internal.CSharpBridgePINVOKE.Manager_GetName__SWIG_0(System.Runtime.InteropServices.HandleRef, System.String ByRef)
at ETM.WCCOA.Internal.Manager.GetName(ETM.WCCOA.Internal.DpIdentifier, System.String ByRef)
at ETM.WCCOA.OaProcessModel.DoGetDpPathByInternalDpIdentifierUnsafe(ETM.WCCOA.Internal.DpIdentifier)
at ETM.WCCOA.OaDpValueItem..ctor(ETM.WCCOA.OaManager, ETM.WCCOA.Internal.DpVCItem)
at ETM.WCCOA.ActiveObjects.DpHotlinkMessage.ProcessHotlinkReply(ETM.WCCOA.Internal.DpHLGroup)
at ETM.WCCOA.InternalHotlinkWaitForAnswer.HotLinkCallBack(ETM.WCCOA.Internal.DpHLGroup)
at ETM.WCCOA.Internal.HotLinkWaitForAnswer.SwigDirectorHotLinkCallBack__SWIG_2(IntPtr)
at ETM.WCCOA.Internal.CSharpBridgePINVOKE.Manager_DoReceiveSwigExplicitManager__SWIG_0(System.Runtime.InteropServices.HandleRef, System.Runtime.InteropServices.HandleRef)
at ETM.WCCOA.Internal.Manager.DoReceive(ETM.WCCOA.Internal.DpMsg)
at ETM.WCCOA.Internal.ManagerWrapper.DoReceive(ETM.WCCOA.Internal.DpMsg)
at ETM.WCCOA.Internal.Manager.SwigDirectorDoReceive__SWIG_0(IntPtr)
at ETM.WCCOA.Internal.CSharpBridgePINVOKE.Manager_Dispatch__SWIG_2(Double)
at ETM.WCCOA.Internal.Manager.Dispatch(Double)
at ETM.WCCOA.OaManager.CommunicationThreadWorker()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
at ETM.WCCOA.Internal.CSharpBridgePINVOKE.ErrClass___toString__(System.Runtime.InteropServices.HandleRef)
at ETM.WCCOA.Internal.ErrClass.__toString__()
at ETM.WCCOA.OaErrorException.get_Message()
at CROC.Industrial.WCCOAOnlineComm.SyncWithAnotherWCC.SynchronizationWCCOA._subs_ValuesChanged(System.Object, ETM.WCCOA.OaSubscriptionMultiValueChangedEventArgs)
at ETM.WCCOA.OaDpValueSubscriptionBase.<StartListSubscription>b__41_0(System.Object, ETM.WCCOA.ActiveObjects.DpHotlinkEventArgs)
at ETM.WCCOA.ActiveObjects.DpConnectAction.<CreateHotlink>b__26_0(System.Object, ETM.WCCOA.ActiveObjects.DpHotlinkEventArgs)
at ETM.WCCOA.ActiveObjects.DpHotlinkMessage.ExecuteReply()
at ETM.WCCOA.OaManager.PerformReplyQueue(ETM.WCCOA.ActiveObjectQueue)
at ETM.WCCOA.OaManager.HotlinkThreadWorker()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
at ETM.WCCOA.Internal.CSharpBridgePINVOKE.ErrClass___toString__(System.Runtime.InteropServices.HandleRef)
at ETM.WCCOA.Internal.ErrClass.__toString__()
at ETM.WCCOA.OaErrorException.get_Message()
at CROC.Industrial.WCCOAOnlineComm.SyncWithAnotherWCC.SynchronizationWCCOA._subs_ValuesChanged(System.Object, ETM.WCCOA.OaSubscriptionMultiValueChangedEventArgs)
at ETM.WCCOA.OaDpValueSubscriptionBase.<StartListSubscription>b__41_0(System.Object, ETM.WCCOA.ActiveObjects.DpHotlinkEventArgs)
at ETM.WCCOA.ActiveObjects.DpConnectAction.<CreateHotlink>b__26_0(System.Object, ETM.WCCOA.ActiveObjects.DpHotlinkEventArgs)
at ETM.WCCOA.ActiveObjects.DpHotlinkMessage.ExecuteReply()
at ETM.WCCOA.OaManager.PerformReplyQueue(ETM.WCCOA.ActiveObjectQueue)
at ETM.WCCOA.OaManager.HotlinkThreadWorker()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
at ETM.WCCOA.Internal.CSharpBridgePINVOKE.Manager_GetName__SWIG_0(System.Runtime.InteropServices.HandleRef, System.String ByRef)
at ETM.WCCOA.Internal.Manager.GetName(ETM.WCCOA.Internal.DpIdentifier, System.String ByRef)
at ETM.WCCOA.OaProcessModel.DoGetDpPathByInternalDpIdentifierUnsafe(ETM.WCCOA.Internal.DpIdentifier)
at ETM.WCCOA.OaDpValueItem..ctor(ETM.WCCOA.OaManager, ETM.WCCOA.Internal.DpVCItem)
at ETM.WCCOA.ActiveObjects.DpHotlinkMessage.ProcessHotlinkReply(ETM.WCCOA.Internal.DpHLGroup)
at ETM.WCCOA.InternalHotlinkWaitForAnswer.HotLinkCallBack(ETM.WCCOA.Internal.DpHLGroup)
at ETM.WCCOA.Internal.HotLinkWaitForAnswer.SwigDirectorHotLinkCallBack__SWIG_2(IntPtr)
at ETM.WCCOA.Internal.CSharpBridgePINVOKE.Manager_DoReceiveSwigExplicitManager__SWIG_0(System.Runtime.InteropServices.HandleRef, System.Runtime.InteropServices.HandleRef)
at ETM.WCCOA.Internal.Manager.DoReceive(ETM.WCCOA.Internal.DpMsg)
at ETM.WCCOA.Internal.ManagerWrapper.DoReceive(ETM.WCCOA.Internal.DpMsg)
at ETM.WCCOA.Internal.Manager.SwigDirectorDoReceive__SWIG_0(IntPtr)
at ETM.WCCOA.Internal.CSharpBridgePINVOKE.Manager_Dispatch__SWIG_2(Double)
at ETM.WCCOA.Internal.Manager.Dispatch(Double)
at ETM.WCCOA.OaManager.CommunicationThreadWorker()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
at ETM.WCCOA.Internal.CSharpBridgePINVOKE.ErrClass___toString__(System.Runtime.InteropServices.HandleRef)
at ETM.WCCOA.Internal.ErrClass.__toString__()
at ETM.WCCOA.OaErrorException.get_Message()
at CROC.Industrial.WCCOAOnlineComm.SyncWithAnotherWCC.SynchronizationWCCOA._subs_ValuesChanged(System.Object, ETM.WCCOA.OaSubscriptionMultiValueChangedEventArgs)
at ETM.WCCOA.OaDpValueSubscriptionBase.<StartListSubscription>b__41_0(System.Object, ETM.WCCOA.ActiveObjects.DpHotlinkEventArgs)
at ETM.WCCOA.ActiveObjects.DpConnectAction.<CreateHotlink>b__26_0(System.Object, ETM.WCCOA.ActiveObjects.DpHotlinkEventArgs)
at ETM.WCCOA.ActiveObjects.DpHotlinkMessage.ExecuteReply()
at ETM.WCCOA.OaManager.PerformReplyQueue(ETM.WCCOA.ActiveObjectQueue)
at ETM.WCCOA.OaManager.HotlinkThreadWorker()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
at ETM.WCCOA.Internal.CSharpBridgePINVOKE.Manager_GetName__SWIG_0(System.Runtime.InteropServices.HandleRef, System.String ByRef)
at ETM.WCCOA.Internal.Manager.GetName(ETM.WCCOA.Internal.DpIdentifier, System.String ByRef)
at ETM.WCCOA.OaProcessModel.DoGetDpPathByInternalDpIdentifierUnsafe(ETM.WCCOA.Internal.DpIdentifier)
at ETM.WCCOA.OaDpValueItem..ctor(ETM.WCCOA.OaManager, ETM.WCCOA.Internal.DpVCItem)
at ETM.WCCOA.ActiveObjects.DpHotlinkMessage.ProcessHotlinkReply(ETM.WCCOA.Internal.DpHLGroup)
at ETM.WCCOA.InternalHotlinkWaitForAnswer.HotLinkCallBack(ETM.WCCOA.Internal.DpHLGroup)
at ETM.WCCOA.Internal.HotLinkWaitForAnswer.SwigDirectorHotLinkCallBack__SWIG_2(IntPtr)
at ETM.WCCOA.Internal.CSharpBridgePINVOKE.Manager_DoReceiveSwigExplicitManager__SWIG_0(System.Runtime.InteropServices.HandleRef, System.Runtime.InteropServices.HandleRef)
at ETM.WCCOA.Internal.Manager.DoReceive(ETM.WCCOA.Internal.DpMsg)
at ETM.WCCOA.Internal.ManagerWrapper.DoReceive(ETM.WCCOA.Internal.DpMsg)
at ETM.WCCOA.Internal.Manager.SwigDirectorDoReceive__SWIG_0(IntPtr)
at ETM.WCCOA.Internal.CSharpBridgePINVOKE.Manager_Dispatch__SWIG_2(Double)
at ETM.WCCOA.Internal.Manager.Dispatch(Double)
at ETM.WCCOA.OaManager.CommunicationThreadWorker()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()