From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Automatically Restart Express vi Following Error

Solved!
Go to solution

Another newbie question, I'm afraid...

I'm writing an application that will spool data to a spreadsheet for a time period that might turn out to be several weeks, or months.  I set out to make the application save redundant data, in an effort to make sure I could survive a power outage in the fairly inevitable event that it occurs in that time period. 

 

That has all gone well now that I've worked through several problems with the data formatting, so I set up the program to run through a test period last week and (fortunately, I guess) the power went off.  Since the vi runs on a laptop, the battery kept things going until the power came back on, and the vi never shut down.  However, because the attached hardware lost power (unlike my example below, the hardware uses a cDaq chassis), the program threw an unhandled error and things ground to a halt, awaiting user input before permitting data collection to restart.

I am looking for a way to manage errors, then, such that they will not stop the program from running.  Instead, I simply want to go to an error handling routine that waits a bit and then resets the Express vi, which presumably will error out again if the hardware's power is still off.  I am using a method that would make a machine controls programmer cry, but essentially I just look at the Status part of the Error out cluster, switching on an indicator if an error is detected and also starting a while loop that contains nothing but a timer.  This appears to work for the most part; it does, at least, permit the vi to continue running without crashing when I pull the plug on my USB-6008, which is running behind the Express DAQ. 

When I plug the device back in, however, the status of the loop resets (if I probe it in the block diagram it reads, "FALSE") but the Express DAQ doesn't restart and the ERROR indicator does not clear. 

I am guessing there is a really simple way to update the status in a way that the downstream program elements can see, but don't know it.  Any ideas?

 

Thanks,

 

Danielle

 

ERROR HANDLER.jpg

0 Kudos
Message 1 of 7
(4,091 Views)
Solution
Accepted by topic author danielleoh

In the user dialog functions there is a clear error function that you could put in the delay loop...You might add a create constant error in to the error in for the DAQ thing....maybe that would do it...

 

If you want to get real cute..can take the error case and decluster the error code to another case that will handle the specific error number...Use the general error handeling function and set it to clear the error when it matches the number you get when the system goes down...Or just clear all of them and see what happens.

 

Sorry ... I don't have any DAQ on the machine here to try it.

 

Hope that helps.

 

Hummer1

0 Kudos
Message 2 of 7
(4,086 Views)

Ni-i-i-ce!  Who knew there was such a function?

Thanks for the help; this works just fine.  No need for the extra loop, although I will probably extend the process a bit and make it error-specific, so something can come up on the screen while the vi is not collecting data.

 

Thanks!

 

Danielle

 

 

ERROR HANDLER2.jpg

0 Kudos
Message 3 of 7
(4,081 Views)

wasn't specific enough.

 

Try this.

 

Hope that helps.

 

Hummer1

 

0 Kudos
Message 4 of 7
(4,078 Views)

Sorry, I should have said; I'm using LV 8.6.  Any chance you could save that back to that version?

 

Thanks,

 

Danielle

0 Kudos
Message 5 of 7
(4,070 Views)

I think this is 8.6  ... see what you think.

 

Hummer1

Message 6 of 7
(4,040 Views)

Very nice; I guess that's the way grownups handle errors.  I can definitely use this approach to sort through the errors; don't want to blatantly dismiss just anything that goes wrong.  I do want to be sure we can ride through the inevitable power-outage-on-a-weekend-when-nobody's-there scenario, though.

 

Thanks!

 

Danielle

0 Kudos
Message 7 of 7
(4,026 Views)