LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

store error

Hi,

 

I am running a labview application on a test stand. Sometimes the application crashes and displays an error with two options "Stop" and "Continue". When this happens I would like to stop the application automataically and store the error information in a log file. What would be the best way to do this?

 

Thanks in advance.

 

Mudda.

0 Kudos
Message 1 of 5
(2,487 Views)

The best way would be to fix the code. The most likely reason for this is that a Read From Spreadsheet File or Write to Spreadsheet File VI is receiving an empty path. Inside of those VIs is a General Error Handler (bad design of a VI on NI's part), which is what's displaying the dialog box.

 

Are you using one of those two VIs?

0 Kudos
Message 2 of 5
(2,472 Views)

Hi,

 

Thanks for the reply, I understand what you say but the case is I can fix the code when I know whats happening. During the test I am not at the test computer, when the application crashes I usually tell the technician to make a screen shot and save it as a bit map. They follow it most of the times, but sometimes when they dont save it they try to explain me what happened and usually it will be lost in the translation. In order to avoid this and also instead of relaying on other people I would like to store the error information automatically. If I can do this that would be awesome.

 

Thanks,

 

Mudda.

0 Kudos
Message 3 of 5
(2,469 Views)

I figured this was the case, but as I mentioned, the most likely cause is that you are using a VI that has an embedded General Error Handler, like the "Read From Spreadsheet File" VI. In this case the best solution is to test the path to make sure it's not an empty path, and if it is, don't run that VI. 

 

You're basically asking about dismissing a dailog box that's designed to be dismissed by a person, not by a computer. The way to deal with this is:

  • Change the VI that creates the dialog so it doesn't get created in the first place. If it's the General Error Handler this means changing this VI. This is REALLY BAD idea. 
  • Have a parallel VI/App/whatever that monitors to see if that window appears. If so, send a keystroke using the operating system API to simulate a user pressing the key. At the same time, you can log the error information however you want.
  • Deal with the condition that causes the error before it ever happens. 
  • Use a modified version of the VI that doesn't have the embedded General Error Handler. For instance, I use a modified version of the "Read From Spreadsheet File" that has error I/O clusters rather than an embedded General Error Handler, which is the way NI should have written that VI in the first place. 
0 Kudos
Message 4 of 5
(2,464 Views)

Hi,

 

Thanks for the information. Based on your recommendations I got some ideas, I will try to implement them and see how they work.

 

Mudda.

0 Kudos
Message 5 of 5
(2,460 Views)