C# WPF Beckhoff application crash

-5

I am developing an application C# WPF. The GUI uses WPF as graphical framework to create the user interface and it uses TwinCAT.Ads.dll to communicate with the TwinCAT system.

The application is experiencing some random crashes during the time.

The version of the TwinCAT.Ads.dll library is: 4.4.0.0.

From what I see the crashes happend by any call to the various API of the Ads library in random moment of the application life cycle. For example they must happen after one or two day that the application is running or not. Some time they happens also during the initialization.

Here will follow some messages that I was able to capture by the Visual studio debbugger.

Message 1

System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.

at TwinCAT.Ads.Internal.TcAdsDllWrapper.UnsafeNativeMethods.AdsSyncReadReqEx2(Int32 port, Byte* addr, UInt32 indexGroup, UInt32 indexOffset, Int32 length, Void* data, Int32* pcbReturn)

at TwinCAT.Ads.Internal.TcAdsSyncPortRouter.Read(UInt32 indexGroup, UInt32 indexOffset, Int32 length, Void* data, Boolean throwAdsException, Int32& dataRead)

at TwinCAT.Ads.Internal.TcAdsDllWrapper.ReadBoolean(UInt32 indexGroup, UInt32 indexOffset, Boolean throwAdsException, AdsErrorCode& result)

at TwinCAT.Ads.Internal.TcAdsSyncPort.ReadAny(UInt32 indexGroup, UInt32 indexOffset, Type type, Boolean throwAdsException, Object& value)

at TwinCAT.Ads.Internal.AdsRawInterceptor.<>c__DisplayClass16_0.b__0()

at TwinCAT.Ads.CommunicationInterceptor.Communicate(Func`1 action)

at TwinCAT.Ads.Internal.AdsRawInterceptor.Invoke(Func`1 del)

at TwinCAT.Ads.Internal.AdsRawInterceptor.ReadAny(UInt32 indexGroup, UInt32 indexOffset, Type type, Boolean throwAdsException, Object& value)

at TwinCAT.Ads.TcAdsClient.ReadAny(UInt32 indexGroup, UInt32 indexOffset, Type type)

at TwinCAT.Ads.AdsConnection.ReadAny(UInt32 indexGroup, UInt32 indexOffset, Type type)

at Fleury.Ads.Comm.AdsVariableWrapper`1.Read(AdsConnection connection) in C:\SVN\Modulo\trunk\Projets\Tools\ApplicationAds\trunk\ApplicationAds\ApplicationAds\Comm\AdsVarWrapper.cs:line 172

at Application.Model.DataCenter.UpdateMachine(AdsConnection connection) in C:\SVN\Modulo\trunk\Projets\GUI\trunk\Application\Model\DataCenter.cs:line 897

at Application.ViewModel.MainWindowViewModel.Update() in C:\SVN\Modulo\trunk\Projets\Application\trunk\Application\ViewModel\MainWindowViewModel.cs:line 164 2020-03-06 23:47:09Z

Message 2

mfc100.dll!CThreadSlotData::GetThreadValue(int) Unknown

mfc100.dll!CThreadLocalObject::GetData(class CNoTrackObject * (*)(void)) Unknown

mfc100.dll!AFX_MAINTAIN_STATE2::AFX_MAINTAIN_STATE2(class AFX_MODULE_STATE *) Unknown

AdsDll.dll!66102b24() Unknown

AdsDll.dll![Frames below may be incorrect and/or missing, no symbols loaded for AdsDll.dll] Unknown

[External Code]

ApplicationAds.dll!Application.Ads.Comm.AdsVariableWrapper.Create(TwinCAT.Ads.AdsConnection connection, string symbolName, Application.Logging.IMessageReportable messageReportable) Line 49 C#

ApplicationGUI.exe!Application.Application.Model.Tracing.WorkpieceData.Initialize(TwinCAT.Ads.AdsConnection connection) Line 165 C#

ApplicationGUI.exe!Application.Application.Model.Tracing.SlotData.Initialize(TwinCAT.Ads.AdsConnection connection) Line 148 C#

ApplicationGUI.exe!Application.Application.Model.Tracing.BasketData.Initialize(TwinCAT.Ads.AdsConnection connection) Line 158 C#

ApplicationGUI.exe!Application.Application.Model.Tracing.StackData.Initialize(TwinCAT.Ads.AdsConnection connection) Line 162 C#

ApplicationGUI.exe!Application.Application.Model.Tracing.ModuleLift.Initialize(TwinCAT.Ads.AdsConnection connection) Line 144 C#

ApplicationGUI.exe!Application.Application.Model.DataCenter.InitializeTracing(TwinCAT.Ads.AdsConnection connection) Line 1560 C#

ApplicationGUI.exe!Application.Application.Model.DataCenter.Initialize() Line 252 C#

ApplicationGUI.exe!Application.Application.App.OnStartup(System.Windows.StartupEventArgs e) Line 214 C#

[External Code]

ApplicationGUI.exe!Application.Application.App.Main() Line 71
C#

[External Code]

Message 3

Managed Debugging Assistant 'FatalExecutionEngineError'
Message=Managed Debugging Assistant 'FatalExecutionEngineError' : 'The runtime has encountered a fatal error.

The address of the error was at 0x6bb92c30, on thread 0x274. The error code is 0xc0000005.

This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code.

Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.'

What the problem could be?

c#
wpf
crash
twincat
asked on Stack Overflow Apr 10, 2020 by FLO • edited Apr 10, 2020 by Flithor

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0