Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

Exception when calling BrowseServers() while subscribed

More
13 Apr 2014 16:10 #1829 by mrltk
Thanks for looking into this issue.

I also see the null reference exception if the Refresh Current Network button gets clicked too fast. It looks like I didn't disable the Refresh Current Network button while the background worker is running in this test version.

The Refresh Current Network button shouldn't be pressed until after you've opened up the Network Tree node to view your machine.

With regards to your possible parallel calls issue, do the calls made by the Subscribed Items run in parallel with the BrowseServers? Something like that could explain why that SEHException occurs randomly and why it only occurs when there are OPC Item Subscriptions active. Could OPC communications duration be longer with some of my OPC Test Servers which could increase the likelihood of these calls to overlap?

Please Log in or Create an account to join the conversation.

More
13 Apr 2014 12:15 - 15 Apr 2014 10:24 #1827 by support
[received the project OPCLabsTest.zip and instructions by email]

I have successfully modified and rebuilt the project, and I am running the test according to the instructions. Unfortunately, so far I have been unable to reproduce any of the issues. I will continue trying (I intend to use a different computer, and possibly install SharpDevelop; currently I have loaded you project into Visual Studio).

Note that when quickly repeatedly clicking on the button and the "+" expansion sign, I often get following exception instead:
System.NullReferenceException: Object reference not set to an instance of an object.
   at OPCLabsTest.OPCExplorer.bw_exploremachines(Object sender, DoWorkEventArgs e) in ...\OPCExplorer.cs:line 237

This is because nodes_being_searched == null; you may want to look at this. But I do not think this is related to the problem you reported (except that it may actually be preventing it from happening?).

The other thing I intend to do is a close review of the BrowseServers code. I have already found one possible issue - but that would only manifest itself if multiple calls to it are made in parallel, which should not be in your case, because although you make the work on a background thread, you seem to wait for completion before starting a new one.
Last edit: 15 Apr 2014 10:24 by support.

Please Log in or Create an account to join the conversation.

More
07 Apr 2014 17:52 #1817 by mrltk
I've created a small application using SharpDevelop that reproduces the SEHException. Could you please provide an e-mail address so that I can send it to you.

Also, I've noticed since switching to 5.23, my main application throws the following exception almost every time I close the program:

System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at COCKTopicParameters.=(COCKTopicParameters* , COCKTopicParameters* rhs)
at COCKTopicParameters.{ctor}(COCKTopicParameters* , COCKTopicParameters* Parameters, Int32 )
at OpcLabs.EasyOpcRaw.DataAccess.RawEasyDATopicParameters.Done(Boolean finalize)
at OpcLabs.EasyOpcRaw.DataAccess.RawEasyDATopicParameters.!RawEasyDATopicParameters()
at OpcLabs.EasyOpcRaw.DataAccess.RawEasyDATopicParameters.Dispose(Boolean )
at OpcLabs.EasyOpcRaw.DataAccess.RawEasyDATopicParameters.Finalize()

This exception seems to be caused by setting the following at the beginning of the program:
EasyDAClient.SharedParameters.Client.ClientReconnectDelay = 10000;
EasyDAClient.SharedParameters.Client.ServerFailedReconnectDelay = 10000;
EasyDAClient.SharedParameters.Client.ServerShutdownReconnectDelay = 10000;

Talk to you soon,

Tom.

Please Log in or Create an account to join the conversation.

More
06 Apr 2014 22:55 #1816 by mrltk
Thanks for the quick response!

I just built the program using 5.23. I am still having the same issues where the browseServers() function occasionally throws a SEHException and the EasyDAClient never recovers and sometimes crashes.

Some new info:

-If running in release mode, the issue seems to occur less frequently.

-Calling browseServers() immediately following a response increases the likelihood of throwing the SEHException.

-The following error occurred right after I tried to close the program after causing the initial SEHException issue.

System.Runtime.InteropServices.SEHException: External component has thrown an exception.
at AfxThrowInvalidArgException()
at CConsumer.{dtor}(CConsumer* )
at COCKConsumerBase.{dtor}(COCKConsumerBase* )
at COCKConsumer.{dtor}(COCKConsumer* )
at CEDAConsumer.{dtor}(CEDAConsumer* )
at CEDAAbstractEngine.{dtor}(CEDAAbstractEngine* )
at OpcLabs.EasyOpcRaw.DataAccess.CDAInnerEngine.{dtor}(CDAInnerEngine* )
at OpcLabs.EasyOpcRaw.DataAccess.CDAInnerEngine.__vbaseDtor(CDAInnerEngine* )
at OpcLabs.EasyOpcRaw.DataAccess.CDAInnerEngine.__vecDelDtor(CDAInnerEngine* , UInt32 )
at CEasyAbstractModule.DestroyDAEngine(CEasyAbstractModule* , CEDAAbstractEngine** pDAEngine)
at CEasyAbstractModule.ModuleStop(CEasyAbstractModule* )
at OpcLabs.EasyOpcRaw.CInnerModule.ModuleStop(CInnerModule* )
at OpcLabs.EasyOpcRaw.CInnerModule.{dtor}(CInnerModule* )
at ?A0x5e6d74c4.??__F_Module@@YMXXZ()
at _exit_callback()
at <CrtImplementationDetails>.LanguageSupport._UninitializeDefaultDomain(Void* cookie)
at <CrtImplementationDetails>.LanguageSupport.UninitializeDefaultDomain()
at <CrtImplementationDetails>.LanguageSupport.DomainUnload(Object source, EventArgs arguments)
at <CrtImplementationDetails>.ModuleUninitializer.SingletonDomainUnload(Object source, EventArgs arguments)


I can look to spend time creating a test program to demonstrate my issue if required.

Tom.

Please Log in or Create an account to join the conversation.

More
06 Apr 2014 16:22 #1815 by support
Can you try to rebuild with version 5.30 (if you can switch to .NET Framework 4.5+), or version 5.23 (otherwise)?

This is an internal kind of error so it is unlikely that there is something wrong with your code. Still, would it be possible that you send the project (or the relevant parts of it) to me? This way we should be hopefully be able to reproduce, which is necessary in order to fix it.

Please Log in or Create an account to join the conversation.

More
04 Apr 2014 19:44 #1814 by mrltk
When I call BrowseServers() while my program is subscribed to multiple items I frequently (sometimes, but not always) throw this exception:

System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.
at OpcLabs.EasyOpcRaw.DataAccess.CDAInnerEngine.ExecuteAlgorithm(CDAInnerEngine* , CSynchronizedAlgorithm* Algorithm)
at CEDAAbstractEngine.BrowseServers(CEDAAbstractEngine* , Char* MachineIsolator, Char* MachineName, CEDAAbstractMode* pMode, CEasyServerElementMap* ServerElementMap)
at OpcLabs.EasyOpcRaw.DataAccess.RawEasyDAClient.BrowseServers(String machineName)
at OpcLabs.EasyOpc.DataAccess.EasyDAClient.BrowseServers(String machineName)


The program is trying to scan itself for OPC Servers. Some of these servers' OPC Items are subscribed to by an EasyDAClient instantiated by the MainForm thread. While subscribed, a background worker thread's EasyDAClient instance tries to call BrowseServers().

The BrowseServers() call throws the Exception above. Once this exception occurs, any future call to BrowseServers() fails with the same exception throughout the lifetime of the program. Too many attempts in a row after the exception is thrown freezes or crashes the program completely.

Restarting the program seems to help.

The program is a C Sharp program. I am using EasyDAClient Dot Net version 5.21 with SharpDevelop in Debug Mode on the Windows 7 x64 bit OS. The program's platform is x86 and Dot Net 4.0 Client.

Any help would be greatly appreciated.

Tom.

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.057 seconds