08-02-2015 04:46 PM
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
08-02-2015 06:45 PM
08-02-2015 06:53 PM
@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.
08-02-2015 08:24 PM
@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?
08-03-2015 12:11 AM
08-03-2015 02:01 AM - edited 08-03-2015 02:09 AM
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
08-03-2015 02:02 AM
Psireaper9, General 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.
08-03-2015 07:10 AM
@kosist90 wrote:
@Psireaper9, General 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.
Simle error handler has an output for the text you are looking for in this post.
08-03-2015 07:24 AM
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.
08-03-2015 10:05 AM
@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.