LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error with "Open/Create/Replace File" function with cancel button

Solved!
Go to solution

I've attached a very simple VI that embodies what I want to do with my Open File function. I simply want to stop the rest of my program (theoretically encased in the Case Structure) from running if the user deigns not to specify a file location.

 

However, if the Cancel button is clicked an error is produced before the rest of the program runs. If you ignore the error and continue, the "cancelled' variable is appropriately made true and the Case Structure runs properly. I simply want to remove the error message LabView gives me.

 

Any ideas on why or how?

0 Kudos
Message 1 of 5
(1,251 Views)
Solution
Accepted by topic author beckermt

Read the LabVIEW Help on Automatic Error Handling.

 

In your case, you can just wire the error cluster output to your case structure.

 

Auto Error Handling.png

Message 2 of 5
(1,244 Views)

If you don't want automatic error handling, just turn it off or wire up the error out cluster.

0 Kudos
Message 3 of 5
(1,243 Views)

The cancel button gives you error code 43 (if I remember correctly). After your file vi's, use the general error handler (GEH) to clear this error (and no other errors). Use

[exception action]=Cancle Error on Match

[exception code]=43

type of dialog=no dialog

GEH_Cancle Error.PNG

 

Felix

0 Kudos
Message 4 of 5
(1,238 Views)

Excellent! Thanks for the information, guys. I'll read about Automatic Error Handling and get this fixed right up!

0 Kudos
Message 5 of 5
(1,228 Views)