LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

General Labview Error Handler question discussion

Recently two functions were brought to my attention, the General Error Handler and the Simple Error handler. 
And I cannot wrap my hand around these two features.  While I have been using Labview I have always used the Labview error cluster.  When would you use these two features?  As I feel the cluster error is much help. 

Maybe it is my defnition that I have confused: 

The general error handler will display a dialogue box describing the error that will be passed and shuts down the code? 

The simple error handler notifys the operator that an error has occured but it can be customized for adding functionality, it takes the error cluster input and determines if an error was generated.  "If an error has been generated, the VI displays a dialog box with the error code, a brief description of the error, and the location of the error."   How is this not the same as an error cluster?  
 

If anyone has any simple code examples for this or knowledge I greatly appriciate it. 

 

Caleb

0 Kudos
Message 1 of 13
(6,274 Views)
Actually, in my opinion you should never use either one in deliverable code. The problem.is that they both allow you to abort LabVIEW like clicking the abort button on the menu bar. This is not good because it doesn't allow you to deinitialize external systems or get them back.to a safe state.

What I do use is a modified version that doesn't include the abort function. Instead it outputs a Boolean value that tells the calling code if the operator wants to stop.

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 13
(6,236 Views)

@Psireaper9 wrote:

 

The simple error handler notifys the operator that an error has occured but it can be customized for adding functionality, it takes the error cluster input and determines if an error was generated.  "If an error has been generated, the VI displays a dialog box with the error code, a brief description of the error, and the location of the error."   How is this not the same as an error cluster?  
 


You are correct that they give the same information.  The difference is that if you want to use an error cluster you will need an indicator on your front panel.  If you use the simple error handler you won't have to have an error cluster on your front panel but the user will be notified if an error does occur.

 

Think about all the programs you normally use (excel, chrome, etc.).  As a user you expect that errors aren't happening, and if errors do occur then the application will usually just close out and you get an error dialog about the error.

Matt J | National Instruments | CLA
0 Kudos
Message 3 of 13
(6,232 Views)

@Jacobson-ni wrote:

@Psireaper9 wrote:

 

The simple error handler notifys the operator that an error has occured but it can be customized for adding functionality, it takes the error cluster input and determines if an error was generated.  "If an error has been generated, the VI displays a dialog box with the error code, a brief description of the error, and the location of the error."   How is this not the same as an error cluster?  
 


You are correct that they give the same information.  The difference is that if you want to use an error cluster you will need an indicator on your front panel.  If you use the simple error handler you won't have to have an error cluster on your front panel but the user will be notified if an error does occur.

 

Think about all the programs you normally use (excel, chrome, etc.).  As a user you expect that errors aren't happening, and if errors do occur then the application will usually just close out and you get an error dialog about the error.


I use the simple error handler with no user interaction to extract the error text.  Is there an easier way of doing that?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 13
(6,176 Views)
Yes, Look inside it and you will find a subVI that has as its input error code and output the description.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

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

For help with grief and grieving.
Message 5 of 13
(6,066 Views)

I'm not sure I agree that finding a VI from vi.lib or clicking through a few levels of subVI hierarchy is particularly easier than dropping a VI from the standard Dialog palette and creating a constant 'no dialog' for General Error Handler. It also has the benefits of being familiar code for anyone coming along to support it in the future and being findable via Quick Drop.

 

Once you've bundled Error Code Database.vi into your own reusable error module (preferably adding comments in the calling VI to make up for its lack of description and tip strips...it probably wasn't ever intended to be seen by the masses!) then yes, much of this is trivial.

 

Set to 'no dialog', I have zero problem with GEH being used in deliverable code - so long as, as you say previously, you create your own logic and dialog for handling errors that is in keeping with the application.

 

Edit - Simple EH, GEH...same thought applies

---
CLA
0 Kudos
Message 6 of 13
(6,016 Views)

Psireaper9General Error Handler and the Simple Error handler have more detailed description of the error, including reason (description) of the error. But error cluster has just the source. So, those functions give more information, then simple  error cluster.

Error.PNG

Message 7 of 13
(6,014 Views)

@kosist90 wrote:

@Psireaper9General Error Handler and the Simple Error handler have more detailed description of the error, including reason (description) of the error. But error cluster has just the source. So, those functions give more information, then simple  error cluster.

Error.PNG


Simle error handler has an output for the text you are looking for in this post.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 13
(5,950 Views)

I'm surprised nobody has yet to say that Simple Error Handler does nothing but call General Error Handler with a few constants thrown in.  But I have also used the GEH to do a lookup of the error.  I don't like the idea of using buried VIs inside of vi.lib that are not on the palettes.  NI will not guarantee that they will not change them and with no notice.  So you may run into issues between versions if you just use the lookup VI.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 13
(5,946 Views)

@crossrulz wrote:

I'm surprised nobody has yet to say that Simple Error Handler does nothing but call General Error Handler with a few constants thrown in.  But I have also used the GEH to do a lookup of the error.  I don't like the idea of using buried VIs inside of vi.lib that are not on the palettes.  NI will not guarantee that they will not change them and with no notice.  So you may run into issues between versions if you just use the lookup VI.


This precisely why I usually use the Simple Error Handler.  (Because it's simple!)  I rarely need the flexibility of the GEH.

 

Yeah, one of the first things I noticed about the SEH was that it was a wrapper for the GEH.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 10 of 13
(5,901 Views)