LAVA: NI-Week Session: Advanced Error Handling in LabVIEW - LAVA

Jump to content

  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »
  • You cannot start a new topic
  • This topic is locked

NI-Week Session: Advanced Error Handling in LabVIEW Rate Topic: ***** 1 Votes

#1 User is online   crelf 

  • I'm a LAVA, not a fighter.
  • Group: V I Engineering, Inc.
  • Posts: 4,872
  • Joined: 13-October 03
  • Version:LabVIEW 2009
  • Since:1993

Posted 21 May 2009 - 11:20 PM

Brian Gapske (V I Engineering, Inc Test Software and Integration Group) and I will be co-presenting a session called "Advanced Error Handling in LabVIEW" at NI-Week 2009. We've got some interesting stuff to show you, but I'd like to open the floor to see if there's anything anyone would like to hear specifically. Please reply to this thread and let's get some breain storming going. Of course, I can't gaurantee that we'll be able to answer all of your questions in the presentation (there's only so much time in a day :( ) but if you'd like us to skew it to something in particular, this is the place to discuss your ideas.


0

#2 User is offline   Black Pearl 

  • Very Active
  • PipPipPip
  • Group: Members
  • Posts: 208
  • Joined: 12-April 09
  • Location:Freiburg, Germany
  • Version:LabVIEW 7.1
  • Since:2002

Posted 22 May 2009 - 02:18 AM

I would like to see an error handling for multiloop architectures with a dedicated error handling loop. The overall idea is presented in the 'LabVIEW Style book' by P. Blume. But there are no details on the error handling specifically.

One really important thing is how to report errors to users. Using the normal error dialog works nice for me, but users click it away most of the time and then give me a call 'your software is not working'. This is more about psychology than SE.

Felix


0

#3 User is offline   gleichman 

  • Very Active
  • PipPipPip
  • Group: Members
  • Posts: 121
  • Joined: 13-August 03
  • Location:Plymouth, Michigan
  • Version:LabVIEW 8.6
  • Since:1993

Posted 22 May 2009 - 02:48 AM

QUOTE (Black Pearl @ May 20 2009, 06:57 PM)

Quote

One really important thing is how to report errors to users. Using the normal error dialog works nice for me, but users click it away most of the time and then give me a call 'your software is not working'. This is more about psychology than SE.


I agree that usability is a key. I'd sure like to know who at NI thought it was a grand idea to share error 7 between File I/O and GPIB. "Why does my system have a GPIB error? ... Because your configuration is pointing to a file that doesn't exist." I have NEVER in 16 years had a user tell me that there was a File I/O error when an error 7 occured.

I used to be bad at error handling. (I hope Brian isn't using me as the bad example.) I now use a centralized error handler with an error passing vi that makes it simple. With a central error handler, I can log errors and command things to shutdown if severe errors occur.


0

#4 User is offline   Black Pearl 

  • Very Active
  • PipPipPip
  • Group: Members
  • Posts: 208
  • Joined: 12-April 09
  • Location:Freiburg, Germany
  • Version:LabVIEW 7.1
  • Since:2002

Posted 22 May 2009 - 02:59 AM

QUOTE (gleichman @ May 21 2009, 03:27 AM)

Quote

I agree that usability is a key. I'd sure like to know who at NI thought it was a grand idea to share error 7 between File I/O and GPIB. "Why does my system have a GPIB error? ... Because your configuration is pointing to a file that doesn't exist." I have NEVER in 16 years had a user tell me that there was a File I/O error when an error 7 occured.


This is a historical flaw, I don't remember why that happend. They had no central repositiory for the error these times, maybe. But yes, every user is reporting you a GPIB error and never ever a file error.

Felix


0

#5 User is offline   Aristos Queue 

  • LV R&D: I write C++ so you don't have to.
  • Group: NI
  • Posts: 1,812
  • Joined: 15-August 06
  • Location:Austin, TX
  • Version:LabVIEW 8.6
  • Since:2000

Posted 22 May 2009 - 06:01 AM

QUOTE (Black Pearl @ May 20 2009, 08:38 PM)

Quote

This is a historical flaw, I don't remember why that happend. They had no central repositiory for the error these times, maybe. But yes, every user is reporting you a GPIB error and never ever a file error.
Weird... error code 7 is one of the ones I deal with on a daily basis (just today, in fact, I fixed a bug today involving a function returning it and the next function in line not handling it correctly) and I've never had the GPIB error... this could be because except for a week of training 9 years ago, I've never had reason to use GPIB. :-)

The common NI Error Code Database came into being in LV 6.1. Prior to that, every group had its own error codes, and of course, every group started counting at 1... except for one group ( I forget which) that actually used error code zero as an error. Ug. Nowadays we have reserved error code ranges for different products, and we offset the errors coming from the operating system into their own region. There's even two ranges reserved for our customers. :-)


0

#6 User is offline   jdunham 

  • Extremely Active
  • PipPipPipPip
  • Group: Members
  • Posts: 483
  • Joined: 06-March 05
  • Version:LabVIEW 8.6
  • Since:2009

Posted 22 May 2009 - 06:14 AM

QUOTE (Aristos Queue @ May 20 2009, 09:40 PM)

Quote

There's even two ranges reserved for our customers. :-)

With a measly 6000 error codes. We've used a good portion of them, and undoubtedly they would conflict with other users' codes if were were ever to share code. I don't suppose we could have a few more of the 4 billion codes available? Whom do we have to waterboard to make this happen?


0

#7 User is offline   ASTDan 

  • Extremely Active
  • PipPipPipPip
  • Group: Members
  • Posts: 306
  • Joined: 29-May 07
  • Version:LabVIEW 8.6
  • Since:2009

Posted 22 May 2009 - 01:50 PM

I would like your thoughts on the creating the custom Error text file. NI seems to promote that in the Intermediate classes. When I create custom Errors I just use a state machine in my Error handling routine. I tried using the file but I didn't like switching back and forth. I prefer to see them in my block diagram. I would be curious on what you think on using a text file to create you custom errors


0

#8 User is offline   Black Pearl 

  • Very Active
  • PipPipPip
  • Group: Members
  • Posts: 208
  • Joined: 12-April 09
  • Location:Freiburg, Germany
  • Version:LabVIEW 7.1
  • Since:2002

Posted 22 May 2009 - 02:04 PM

QUOTE (ASTDan @ May 21 2009, 02:29 PM)

Quote

I would like your thoughts on the creating the custom Error text file. NI seems to promote that in the Intermediate classes. When I create custom Errors I just use a state machine in my Error handling routine. I tried using the file but I didn't like switching back and forth. I prefer to see them in my block diagram. I would be curious on what you think on using a text file to create you custom errors


I use the <err> and <append> tags. This also avoids collisions with other errors I might define with the same code. (I have made two VIs: Overwrite error and Add Details to Error).
Moving the custom error messages around from project to project was to much hassle.

Felix


0

#9 User is online   crelf 

  • I'm a LAVA, not a fighter.
  • Group: V I Engineering, Inc.
  • Posts: 4,872
  • Joined: 13-October 03
  • Version:LabVIEW 2009
  • Since:1993

Posted 22 May 2009 - 04:58 PM

Quick note to everyone: great idea - and even better to hear that some of you are implementing your own layers to better handle errors in LabVIEW. I encourage you all to upload an code that you think appropriate to better facilitate the discussion. So, upload your ideas: we might even feature them in our presentation!


0

#10 User is online   Jeffrey Habets 

  • Very Active
  • Group: Premium Member
  • Posts: 150
  • Joined: 26-October 04
  • Location:Netherlands
  • Version:LabVIEW 8.6
  • Since:1997

Posted 23 May 2009 - 12:43 AM

I'll try and add my :2cents: to show the concept of how I handle error logging and visualisation in my applications.

I basically have the whole error/message logging encapsulated in a by-ref class. This class:
  • handles logging of the errors/messages to disk
  • rotates logs every N days
  • has an active thread of which optionally the UI can be shown as a (floating) window to see the realtime log
  • publishes log events to interested subscribers through dynamic events
Each parallel loop (including dynamically spawned processes in active objects etc.) takes a reference to the logger object. To make sure all errors are catched all executions chains should end with the AddError method.

Posted Image



In the example here, on error, the default logwindow would be shown (which shows all messages since application start). Whether or not you want that depends on the type of application and where you are in the development cycle. I usually use the catched event to determine what error occured and decide what to do with it (e.g. ignore it, show in a nice UI, quit app, etc.)


---
Jeffrey
VIT
0

#11 User is offline   ASTDan 

  • Extremely Active
  • PipPipPipPip
  • Group: Members
  • Posts: 306
  • Joined: 29-May 07
  • Version:LabVIEW 8.6
  • Since:2009

Posted 23 May 2009 - 02:34 AM

This is my take on error handling

Posted Image



I use a FGV to store User event. On an error I generate a user event and pass the error to my event loop. In the dynamic error event case I have a state machine that can handle whatever error based on the error code, and then perform a custom action (i.e. shut down hardware, perform a certain action to correct the error, etc). I also log all errors generated to a text file.

This I have found works for me because the error dialogs are handeled in the event loop and I can still call other sections of code when the error dialog is displayed.

I am very interested in what other people do to handle their errors.

Dan

P.S. I hope NI gives you the big room for this presentation and doesn't have it at 4:00 on Thurs.


0

#12 User is offline   ohiofudu 

  • More Active
  • PipPip
  • Group: Members
  • Posts: 45
  • Joined: 24-August 05
  • Location:Germany
  • Version:LabVIEW 8.6
  • Since:2000

Posted 23 May 2009 - 01:13 PM

This how I handel Error in my Error Case.

QUOTE (ASTDan @ May 21 2009, 08:13 PM)

Quote

This is my take on error handling

Posted Image



I use a FGV to store User event. On an error I generate a user event and pass the error to my event loop. In the dynamic error event case I have a state machine that can handle whatever error based on the error code, and then perform a custom action (i.e. shut down hardware, perform a certain action to correct the error, etc). I also log all errors generated to a text file.

This I have found works for me because the error dialogs are handeled in the event loop and I can still call other sections of code when the error dialog is displayed.

I am very interested in what other people do to handle their errors.

Dan

P.S. I hope NI gives you the big room for this presentation and doesn't have it at 4:00 on Thurs.


Do it Now...do it Now... masterring over Procastination
0

#13 User is offline   Aristos Queue 

  • LV R&D: I write C++ so you don't have to.
  • Group: NI
  • Posts: 1,812
  • Joined: 15-August 06
  • Location:Austin, TX
  • Version:LabVIEW 8.6
  • Since:2000

Posted 23 May 2009 - 02:33 PM

QUOTE (jdunham @ May 20 2009, 11:53 PM)

Quote

With a measly 6000 error codes. We've used a good portion of them, and undoubtedly they would conflict with other users' codes if were were ever to share code. I don't suppose we could have a few more of the 4 billion codes available? Whom do we have to waterboard to make this happen?
No need for waterboarding. No one had ever asked for a larger range.

As of this morning, the range 500000 to 599999 is now reserved for users.


1

#14 User is online   crelf 

  • I'm a LAVA, not a fighter.
  • Group: V I Engineering, Inc.
  • Posts: 4,872
  • Joined: 13-October 03
  • Version:LabVIEW 2009
  • Since:1993

Posted 23 May 2009 - 09:18 PM

QUOTE (Aristos Queue @ May 22 2009, 09:12 AM)

Quote

As of this morning, the range 500000 to 599999 is now reserved for users.

:thumbup:

I think everyone should move over to the new range and use it exculsively I hereby claim the old ranges for VIE!

I am, of course, joking.


0

#15 User is offline   Aristos Queue 

  • LV R&D: I write C++ so you don't have to.
  • Group: NI
  • Posts: 1,812
  • Joined: 15-August 06
  • Location:Austin, TX
  • Version:LabVIEW 8.6
  • Since:2000

Posted 23 May 2009 - 10:06 PM

QUOTE (crelf @ May 22 2009, 02:57 PM)

Quote

I think everyone should move over to the new range and use it exculsively I hereby claim the old ranges for VIE!
Ah, but you hit on a very real problem: People cannot move to a new range. If we could do that, we would make the GPIB error codes no longer overlap with the LV error codes. But there's a lot of VIs in the world that check for specific error codes as returned values. Changing the error code for a given error can wreck havoc.

Once an error code is allocated, it stays allocated, even if the product is end-of-life, because someone might still be using that product out in the world.


0

#16 User is online   crelf 

  • I'm a LAVA, not a fighter.
  • Group: V I Engineering, Inc.
  • Posts: 4,872
  • Joined: 13-October 03
  • Version:LabVIEW 2009
  • Since:1993

Posted 23 May 2009 - 10:24 PM

QUOTE (Aristos Queue @ May 22 2009, 04:45 PM)

Quote

Ah, but you hit on a very real problem: People cannot move to a new range. If we could do that, we would make the GPIB error codes no longer overlap with the LV error codes. But there's a lot of VIs in the world that check for specific error codes as returned values. Changing the error code for a given error can wreck havoc.

Once an error code is allocated, it stays allocated, even if the product is end-of-life, because someone might still be using that product out in the world.

Oh totally! It would be crazy to decomission error codes.


0

#17 User is offline   jdunham 

  • Extremely Active
  • PipPipPipPip
  • Group: Members
  • Posts: 483
  • Joined: 06-March 05
  • Version:LabVIEW 8.6
  • Since:2009

Posted 23 May 2009 - 11:20 PM

QUOTE (Aristos Queue @ May 22 2009, 06:12 AM)

Quote

No need for waterboarding. No one had ever asked for a larger range.

As of this morning, the range 500000 to 599999 is now reserved for users.


Thanks! :worship:

At the risk of pushing my luck, how about a range specifically reserved for OpenG? :ninja:


0

#18 User is offline   Black Pearl 

  • Very Active
  • PipPipPip
  • Group: Members
  • Posts: 208
  • Joined: 12-April 09
  • Location:Freiburg, Germany
  • Version:LabVIEW 7.1
  • Since:2002

Posted 26 May 2009 - 09:01 AM

Some time ago a published some application framework on the Dark Side; The error handling concept is scetched at the end of posting #2 and beginning of #3.

As far is I read the other posts, we all use events to pass the error data. Other ways of doing it?

Felix


0

#19 User is offline   ShaunR 

  • The 500 club
  • PipPipPipPipPip
  • Group: Members
  • Posts: 594
  • Joined: 31-March 09
  • Version:LabVIEW 2009
  • Since:1994

Posted 26 May 2009 - 10:34 AM

QUOTE (Black Pearl @ May 25 2009, 08:40 AM)

Quote

As far is I read the other posts, we all use events to pass the error data. Other ways of doing it?

Felix

Thats probably because everyone here uses the same topology. (centralised error handling). I use local error handling, since a lots different stuff has to happen if there is an error (not just tell the user) and that would make a centralised error handler a bit of a pig. The only common denominator is that I have to put a dialogue on screen and halt other processes execution ("Launch Error Dialogue.vi") while the operator decides what to do. In the meantime the process that threw the error tries to recover to a safe/stable state. The "Launch Error Dialogue" loads and runs (yup, you guessed it - the "Error Dialogue.vi) which logs to a file and filters the error to provide different options to the user (if required). It can be called from anywhere in the code and can remain on-screen, not show at all (i.e just log) or time out after n seconds (depending on the error level). It also does other things like set off a siren, change traffic light indicators etc. Nice and simple and just plonk it in your error case of the state machine.

One thing that hasn't been discussed so far is error levels.

In my system(s), I have severity/priority levels for errors (Information, System, Critical, Recoverable, Process and Maintenance). What do other people do to prioritise errors (if anything)?


A positive attitude may not solve all your problems, but it will annoy enough people to make it worth the effort. (Herm Albright 1876-1944)

The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones
If you have any trouble sounding condescending, find a C++ programmer to show you how it's done.
จิตใจที่ยิ่งใหญ่วิพากษ์วิจารณ์ความคิด จิตใจสามัญวิพากษ์วิจารณ์เหตุการณ์ แต่จิตใจที่ต่ำต้อยนั้นวิจารณ์เพียงผู้คน
OOP is an OAP. AOP is the POC!

Definitions
Encapsulation: Creating a vi
Class: VI template.
Instantiation: Placing the vi on a diagram
Inheritance: Create Control/Indicator" on a sub vi
Abstraction: A well written vi
Composition: Many sub vis
Singleton: A non re-entrant vi
0

#20 User is offline   Anders Björk 

  • Very Active
  • PipPipPip
  • Group: Members
  • Posts: 200
  • Joined: 31-July 06
  • Location:Sweden
  • Version:LabVIEW 8.5
  • Since:1996

Posted 26 May 2009 - 05:12 PM

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

Quote

Ah, but you hit on a very real problem: People cannot move to a new range. If we could do that, we would make the GPIB error codes no longer overlap with the LV error codes. But there's a lot of VIs in the world that check for specific error codes as returned values. Changing the error code for a given error can wreck havoc.

Once an error code is allocated, it stays allocated, even if the product is end-of-life, because someone might still be using that product out in the world.


Would it not be possible append a totally new errornum series to the end of the source field, introduce new error cluster definition side by side with old one and new error table?

Or even better introduce a new error wire with "fields" status, Errcode, code, (time[optional]), source and Errsource, and have conversions between the new and old error handling. Then better we could have better error message in the new series, while still keep the old in place.


0

Share this topic:


  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »
  • You cannot start a new topic
  • This topic is locked