LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Auto Restart an Executable file after getting crash

Solved!
Go to solution

hi.

the executables should run for many days  almost 365 days continuously.

and the labview executable (exe files) on host computer should not get crash or stuck .

Is there any method to auto restart an labview executable file after it has crashed or stuck due to memory or computer issues?

0 Kudos
Message 1 of 6
(4,379 Views)

Set your executable as startup application in Windows (i guess this is the OS). Beside purchase some kind of watchdog hardware witch can detect malfunction (your LabVIEW app stops sending the periodic "i am still running" msg) and power cycle the PC. Google for "programmable hardware watchdog for PC" keywords...

 

But if you need such reliability, just forget using Windows, and switch to Real Time hardware (NI offers several options, like cRIO, sbRIO, PXI, etc...).

http://www.ni.com/white-paper/14238/en/

 

edit: and here I only mentioned the place where you run your LabVIEW application. Of course, you should program your code in a way, that it will not crash. Coding mistakes can create memory leaks for example, which will lead to a crash after some time...

 

 

 

Message 2 of 6
(4,350 Views)

I'd also first look into making sure your program is robust and free of memory leaks.  But even if you have the most stable program possible, power outages, Windows Update, and BSOD can cause things to not be running.  Here's a few suggestions.

 

Go into the bios settings on the motherboard of the PC.  Set it to turn on the PC when a loss of AC power is restored.  This way if there is a power outage (or UPS dies) when the power is restored the PC turns on.

 

Set your program to run on startup of the OS.  If there is a power outage you'll want your program to start back up.

 

Windows Updates?  If this PC can be disconnected from the internet, do so.  Then turn off all Windows Updates and disable restarting.  Windows 10 makes this a bit difficult with task scheduler having to be disabled and then forced to not be reenabled.

 

Software Watchdog.  Hardware watchdogs are best, but a cheap solution is just to write a program that monitors another program, and if program 1 isn't running then run it.  This can be a program that runs in the system tray and has a few exceptions for things like the PC just logged in, or is being shutdown.  A hardware watchdog can be good too, but I then you need to know how do you restart your program?  Do you need to restart the whole PC?  Can you just pull power or should you do a proper shutdown?

 

Finally an embedded devices is for these long term critical systems.  Getting something RT, or embedded like a dedicated microcontroller or FPGA would probably be best.

0 Kudos
Message 3 of 6
(4,297 Views)

hi

thanks for the valuable suggestions

the scenario is the computer is logging data continuously into citadel database through shared variable.

there is no human interference with computer so often and data should not be missed.

How to find the program in computer is working continuously and in any case of crash there is auto recovery of the program.The computer may not be restarted.

 

0 Kudos
Message 4 of 6
(4,269 Views)

@Sajeesh wrote:

 

How to find the program in computer is working continuously  


Run a test where it continuously logs and see if it crashes...

 


@Sajeesh wrote:

in any case of crash there is auto recovery of the program. 


Did you write software to auto recover from a crash?

 


@Sajeesh wrote:

The computer may not be restarted. 


You need to plan for unexpected shutdowns.  I listed several reasons why the computer maybe unexpectedly turned off and the settings I talked about are going to be important if that every happens.

0 Kudos
Message 5 of 6
(4,258 Views)
Solution
Accepted by Sajeesh

Hi

Hope the solution is there but uncertain

the executable file was assigned in the task scheduler of windows OS

through Control panel>System and Security>Administrative tools>Task Scheduler>Task Scheduler Library>Create Task

In the Create task there are tabs General, Triggers, Actions, Conditions, Settings

In triggers tab- Begin the task-At task creation/modification

                       -Advance settings repeat task every 5 minutes for a duration of indefinitely

In action tab -Action Start a program

                     - program/script the executable file path is given

with this configuration if the executable stops or get closed

automatically the executable file starts running after 5 minutes.

but the front screen is invisible .It works in back ground

 

0 Kudos
Message 6 of 6
(4,237 Views)