Jump to content

Preventing an unstable ActiveX component from crashing my application?


Recommended Posts

I'm using an ActiveX component that crashes every once in a while (maybe once a month). When it crashes, it takes down my entire application. If I use VI server calls to launch the VI that contains the component, instead of calling the VI directly, will my application continue running even if the ActiveX component crashes (and if so, do I need to use the Run VI method instead of call by reference)? Is there an easy way to detect that the VI has crashed and I need to restart it? Unfortunately due to the infrequency of crashes, and my inability to cause them consistently, I can't test this out easily.

Link to comment

QUOTE (ned @ Jun 12 2008, 09:36 AM)

I'm using an ActiveX component that crashes every once in a while (maybe once a month). When it crashes, it takes down my entire application. If I use VI server calls to launch the VI that contains the component, instead of calling the VI directly, will my application continue running even if the ActiveX component crashes (and if so, do I need to use the Run VI method instead of call by reference)? Is there an easy way to detect that the VI has crashed and I need to restart it? Unfortunately due to the infrequency of crashes, and my inability to cause them consistently, I can't test this out easily.

I don't know if using VI server to run the containing VI will help; I expect you'll get the same results. As for detecting if the application has crashed, something to consider is a separate "watchdog application". This separate application regularly checks for your application or regularly receives a ping from your application (within a timeout). If the watchdog application detects your application went out to lunch, it can restart the monitored application. My VB counterparts use this to ensure that their critical RT applications stay running (funny what users will shut down when they perceive the system is running show).

Link to comment

QUOTE (Tim_S @ Jun 12 2008, 10:59 AM)

I don't know if using VI server to run the containing VI will help; I expect you'll get the same results. As for detecting if the application has crashed, something to consider is a separate "watchdog application". This separate application regularly checks for your application or regularly receives a ping from your application (within a timeout). If the watchdog application detects your application went out to lunch, it can restart the monitored application. My VB counterparts use this to ensure that their critical RT applications stay running (funny what users will shut down when they perceive the system is running show).

A watchdog isn't quite what I want here. The ActiveX component handles printing specialized labels in a dispensing system. Whenever I finish one batch (or one size), I call a VI, containing the ActiveX component, to print the next batch of labels. If it crashes, I'd like the rest of the machine to keep doing what it's supposed to be doing, and seemlessly restart the print job. I suppose I could do it the other way - write a daemon that sits and waits for print requests as a separate application, and then if the main application fails to connect to the print daemon it could restart it.

Link to comment

QUOTE (ned @ Jun 12 2008, 12:57 PM)

A watchdog isn't quite what I want here. The ActiveX component handles printing specialized labels in a dispensing system. Whenever I finish one batch (or one size), I call a VI, containing the ActiveX component, to print the next batch of labels. If it crashes, I'd like the rest of the machine to keep doing what it's supposed to be doing, and seemlessly restart the print job. I suppose I could do it the other way - write a daemon that sits and waits for print requests as a separate application, and then if the main application fails to connect to the print daemon it could restart it.

Your last suggestion is the only real solution.

ActiveX has in theory the possibility for a library to be invoked in various modes. One is out of process invokation in which case the ActiveX object is instantiated in its own server process and communicates through RPC and a proxy library with the client. However almost no ActiveX component supports this mode and they are almost all in-process servers. This means they run inside the process that is instantiating them and therefore can affect and also take down that host process. I'm not even sure if LabVIEW does support out of process instantiation of ActiveX components. If it does it won't be a well tested scenario since there are so few ActiveX components that would even support that.

Rolf Kalbermatter

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.