LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error Handling

Solved!
Go to solution

I an relatively new to LabVIEW.  My typical application is testing.  For example, I set a number of registers, modes, blah, blah, then perform a test.  Finally, I return registers to their original state.  The problem lay in that, if I get an error in the process, the rest of the code, including the part where I return registers to proper values, is not run.

 

Any suggestions on how best to handle this in LabVIEW?

 

DH

0 Kudos
Message 1 of 7
(2,707 Views)
Solution
Accepted by Dark Hollow

Sounds like your preceeding error is preventing the clean-up from running.

 

Don't propogate an error cluster that could carry an error to functions that required to clean-up and place it in a safe state.

 

Instead run the error cluster around those functions and use a Merge Error node to make sure you don't loose the message.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 7
(2,706 Views)

Thanks, Ben.

 

DH

0 Kudos
Message 3 of 7
(2,687 Views)

Becareful of ordering though.  Many people use the error clusters as a means of enforcing order.  You many have to use a sequence diagram or other means to ensure proper exeuction order.

 

 

A

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

By sequence diagram, do you refer to what LabVIEW calls a "flat sequence" structure?

 

You point is well taken.  If I understand your terminology, I can envision the solution.

 

DH

0 Kudos
Message 5 of 7
(2,665 Views)

Flat or stacked.

 

Good luck.

 

 

A

Message 6 of 7
(2,657 Views)

Hi,

I will go for flat sequence.

 

Ohiofudu

CLD

Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 7 of 7
(2,616 Views)