LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

error handling

Hi, guys.

I have a program to measure a new radio phone system. It makes 14 test cases for different temperatures and voltages. It can take more than a full day to complete a whole measurement, and at the end the excel result workbook is sent by email. Until here, everithing ok.

The problem is that sometimes the program crashes, and I would like to implement a watchdog error to take care about it, and send an email to the tester (who can be in another room, like is the case) reporting about it. Otherwise, it can be that the program had crashed, and when u go to pick up the results, the measurement hasn´t run completely.

To be more clear, I attach a simple example of the code. The error comes out in "tune_tu_freq.vi". From there, how to abort the execution (it becames infinite with the error) and call a user event in "main.vi" and sent the mail?

I have seen a lot of examples for User Event, but no one looks to fit my problem.

Thanks in advance to everybody.
0 Kudos
Message 1 of 4
(2,346 Views)
Sorry, in the attached file before there is not diagram. Next one is the correct.
0 Kudos
Message 2 of 4
(2,341 Views)
When you say the "program crashes" do you mean that LabVIEW crashes or just the program you have written in LV? If LV has crashed, then no other part of your program will be running to send the message.

If it is just part of your program that fails, you need to have the "watchdog" running independently, in parallel. I would recommend two state machines. The first handles the test. The second is the watchdog. Use queues to communicate the status of the testing program to the watchdog. Status messages could include any errors and if no error, the iteration count which could serve as an indicator that the testing program is still running. Of course if there are other markers of failure those should be queued as well.

A good state machine architecture can often handle errors in such a manner as to permit automatic restart or resumption of the test in process. Careful consideration of error handling and failure modes of your test may make the program sufficiently robust that the watchdog may not be needed.

Lynn
0 Kudos
Message 3 of 4
(2,338 Views)
You just have to place a case structure inside the main while loop. Inside the TRUE case is the e-mailing code. (see attached, LabVIEW 7.1)

The case should be true if (1) last iteration _OR_ (2) error condition. No need for parallel processes or canines ;).
0 Kudos
Message 4 of 4
(2,327 Views)