LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

???Does anyone have any suggestions on errors handling in LabVIEW application?

I have got the idea from some articles about how to handle errors via a global queue. In my application, a TDS3014 oscilloscope, an Agilent 34970A with HP34901A and 34903A options and a Chroma 6310 series DC electronic load are involved. My concerns are:
1. Where can I get error messages information about these instruments,then I can write them in my error database?
2. For what kind of errors, I should stop the program. And for what kind of errors, I just write the error message in a file and continue the program?
0 Kudos
Message 1 of 2
(2,813 Views)
To answer question 1, the error information should be contained in the manuals for the instruments themselves.

The answer to question 2 is much harder in that there is no easy formula. This type of decision has to be based on an intimate knowledge of the application. In general you need to shutdown the appliation when you encounter any error that is:

a) nonrecoverable

and

b) of a nature that would make continued execution of the application either pointless or dangerous.

A recoverable error might be one that be able to clear by reattempting the operation that triggered the error in the first place. For example, say your application has a password-protected screen for entering setups information. If the operator enters the wrong password, there is clearly an error, but you probibly wouldn't want to stop the program because of it--the first time at least. To attempt to recover from this error all you have to do is give the operator another chance to enter the correct password.

To illustrate point "b", let's change the example a bit to say that for whatever reason the operator has to enter the proper password to be able to run your application. In that case, if the operator enters the wrong password several times and finally presses the "cancel" button in the password dialog box, this is an error that would make it pointless to continue the program.

Alternately, say you are sending a command to an instrument that has the effect of enabling a safety system. If that command fails you have to assume that the safety enable failed and continued operation would be dangerous to the operator or equipment, and so shutdown the application.

While on the topic, shutting down the application doesn't mean just stopping the code. You have to bring the entire system back to a safe (low-energy)state BEFORE you allow the software to stop. If you don't, you will have a dangerous system operating without any sort of control or monitoring. In that case if anyone is injured or killed you will be responsible.

As a professional, this is a point you have to keep in front of yourself all the time. You aren't writing a word processor or video game. You make a mistake programming a video game and a character in the game might die prematurely. You make a mistake in programming a control system and someone's mother, father, son or daughter could die prematurely.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 2
(2,813 Views)