Jump to content

Automatic Error Handling - What do you do?


Recommended Posts

QUOTE (Jeffrey Habets @ Sep 8 2008, 02:03 AM)

I second what Jeffery said - it's not a question of being able to explain the error after it happens, it's a question of knowing exactly what errors might be generated so I can make intelligent choices of how to handle them at run time in my deployed applications. Seems there should be a better way than just trying as many potential run-time scenarios as one can think of and then writing the code to handle the errors generated - what about those scenarios you didn't anticipate? Now I've potentially got a customer calling and asking why his system just generated some error that shut down his test when if I had explicit knowledge that error could be generated I might have been able to handle it much more elegantly.

Mark

Link to comment
  • 8 months later...

QUOTE (ASTDan @ Aug 28 2008, 11:12 AM)

So how about it. Error Handling Techniques at NI week 2009 by crelf! :unsure:

QUOTE (crelf @ Aug 28 2008, 11:32 AM)

Sure - remind me when NI's calling for presentation submissions and I'll put my hand up for it.

Consider yourself reminded (I don't actually know when NI calls for presentations, I might already be too late). Of course, I'm hoping the presentation notes will be made available as I won't be able to attend (all non-critical travel has been cut from the budget).

I'm still struggling with my error handling. I was able to glean some ideas from the JKI State Machine, but I still feel like I have a lot to learn in this department.

Link to comment

QUOTE (TobyD @ May 20 2009, 04:55 PM)

QUOTE (ASTDan @ May 20 2009, 05:34 PM)

I saw in the NI week 2009 program a presentation by VI engineering on Error Handling.

Yep, Brian Gapske (V I Engineering, Inc Test Software and Integration Group) and I will be co-presenting "Advanced Error Handling in LabVIEW". I've started a thread here to ask for input on what you'd like to see in our presentation, so if you've got any ideas then absolutely let us know.

Link to comment

QUOTE (TobyD @ Aug 27 2008, 11:16 PM)

I enable it only when debugging, otherwise I leave it off.

I prefer to handle errors in my code, however sometimes code runs funny or has errors that are not trapped because of lack of dataflow for error channel etc

In those cases I turn it on and let labVIEW give me a clue about where I may have screwed up..

Link to comment

I tend to leave it on for that very reason - under normal circumstances every single error should be trapped and either dealt with internally by the VI (if its expected - ie EOF error etc), or sent out on an Error Out terminal. However, it's all to easy to forget to wire an error terminal (esp. when deadlines loom and your trying to code at warp speed - and yes, I know no one here does that... ever ;) ) and the automatic error pop-up can really speed up tracking those things down.

Shaun

Link to comment
QUOTE (mesmith @ Sep 8 2008, 09:52 AM)
I second what Jeffery said - it's not a question of being able to explain the error after it happens, it's a question of knowing exactly what errors might be generated so I can make intelligent choices of how to handle them at run time in my deployed applications. Seems there should be a better way than just trying as many potential run-time scenarios as one can think of and then writing the code to handle the errors generated - what about those scenarios you didn't anticipate? Now I've potentially got a customer calling and asking why his system just generated some error that shut down his test when if I had explicit knowledge that error could be generated I might have been able to handle it much more elegantly.
Look at the online help for Obtain Queue. Search the help for the phrase "This function might return". Is this the sort of thing you're wanting to see on all functions?

Link to comment

QUOTE (Aristos Queue @ May 22 2009, 01:42 PM)

Look at the online help for Obtain Queue. Search the help for the phrase "This function might return". Is this the sort of thing you're wanting to see on all functions?

Exactly. That would help find other possible errors to deal with, when an error from a particular function pops up during debug.

Hmm.. never noticed that before. Is it a new addition? (Good work though!!)

Neville.

PS And while your at it, it would be nice to remove the explanation of the error in and error out clusters which are mostly unnecessary. A simple link to explain what they are would REALLY clean up the help functions, and help focus attention to other parameters which are always more important.

Link to comment

QUOTE (Aristos Queue @ May 22 2009, 10:42 PM)

Look at the online help for Obtain Queue. Search the help for the phrase "This function might return". Is this the sort of thing you're wanting to see on all functions?

Yes, exactly... But it deserves a more prominent space, a bold header: Possible Error codes and the errors should be in some sort of table form with the explanations right there, in-place. (Or at the very least a direct link to the correct place in the error-table..) Now I still have to go and look the error-code up to know what it means.

Link to comment
  • 4 months later...

I've recently started using the automatic error handling. It's annoying, but worthwhile for catching those unwired errors.

Maybe someone knows, is there a way to attach a custom handler or callback to the automatic error handler? (I would occasionally like to inspect, or even modify, my program state when the automatic error handler pops up.)

Thanks,

Joe Z.

I realize now this is a relatively old thread

I don't think so Joe but you can get the behavior you wish with a state machine that is setup to handle both normal states and an error state. Errorr handling is best done by designing architectures to handle them from the ground up. I believe dataflow concept makes this necessary. Its one thing to report an error, quite another to handle it and return to the beginning of the dataflow..

You could write a generalized error handler VI.

Then when an error occurs you could call this VI and have it handle the error based on its number or message. Since its a VI call you have a way to determine if the handler actually 'handled' the error because itcan return information back to you.

The only catch is you need to call this VI when the error occurs, hence the need for designing a state machine that can detect error (after the state) and then redirect to the error state for handling.

You then need to know that the error was handled correctly.

If it was handled nicely you can go back and retry the prior state in the machine, else you escalate the error or close out.

Its a technique talked about in 'LabVIEW Advanced Programming Techniques.' I use it a lot and it is helpful especially with controlling peripherals which don't always behave :)

BTW I turn on error handling to help troubleshoot and its great for catching unwired situations.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.