titanium-as / TitaniumAS.Opc.Client

Open source .NET client library for OPC DA
MIT License
197 stars 93 forks source link

exeption while accessing data using DA Client #49

Open milindmpratiti opened 3 years ago

milindmpratiti commented 3 years ago

I am using TitaniumAS opc client to access data from OPC-DA Server. My windows Program runs fine for few cycles, but then throws exception. More prominently , when I kill the executable and start again. Below is the stack trance. Any clues about possible cause will help me to isolate and fix the problem..


Server connected 16:27:00
2020/10/16 16:29:15:672 [ERROR] TitaniumAS.Opc.Client.Common.ComWrapper - Error: System.Runtime.InteropServices.COMException (0x80010105): The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))
   at TitaniumAS.Opc.Client.Interop.Da.IOPCGroupStateMgt.GetState(Int32& pUpdateRate, Boolean& pActive, String& ppName, Int32& pTimeBias, Single& pPercentDeadband, Int32& pLCID, Int32& phClientGroup, Int32& phServerGroup)
   at TitaniumAS.Opc.Client.Da.Wrappers.OpcGroupStateMgt.<>c__DisplayClass5.<GetState>b__4()
   at TitaniumAS.Opc.Client.Common.ComWrapper.DoComCall(Object comObject, String methodName, Action comAction, Object[] arguments) Method name: IOPCGroupStateMgt::GetState Object: 4436986
Server disconnected 16:30:26

Unhandled Exception: System.Runtime.InteropServices.COMException: The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))
   at TitaniumAS.Opc.Client.Interop.Da.IOPCGroupStateMgt.GetState(Int32& pUpdateRate, Boolean& pActive, String& ppName, Int32& pTimeBias, Single& pPercentDeadband, Int32& pLCID, Int32& phClientGroup, Int32& phServerGroup)
   at TitaniumAS.Opc.Client.Da.Wrappers.OpcGroupStateMgt.<>c__DisplayClass5.<GetState>b__4()
   at TitaniumAS.Opc.Client.Common.ComWrapper.DoComCall(Object comObject, String methodName, Action comAction, Object[] arguments)
   at TitaniumAS.Opc.Client.Da.Wrappers.OpcGroupStateMgt.GetState(TimeSpan& updateRate, Boolean& active, String& name, TimeSpan& timeBias, Single& percentDeadband, Int32& lcid, Int32& clientHandle, Int32& serverHandle)
   at TitaniumAS.Opc.Client.Da.OpcDaGroup.SyncState()
   at TitaniumAS.Opc.Client.Da.OpcDaGroup..ctor(Object groupComObject, OpcDaServer opcDaServer)
   at TitaniumAS.Opc.Client.Da.OpcDaServer.AddGroup(String name, OpcDaGroupState state)
   at DADataAcquisition.DataAcquitionService.addItemsToDAGroup(OpcDaServer server, OpcServerDevice device) in C:\Users\milind\source\repos\DADataAcquisition\DADataAcquisition\DataAcquitionService.cs:line 36
   at DADataAcquisition.DataAcquitionService.<OnTimerEvent>d__7.MoveNext() in C:\Users\milind\source\repos\DADataAcquisition\DADataAcquisition\DataAcquitionService.cs:line 80
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_1(Object state)
   at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()