12-06-2015 01:41 PM
I'm trying to understand the behavior of Simple Error Handler.vi, and it's confusing me because it doesn't appear to be correctly ignoring the error code I give it.
According to the documentation, if I provide an error code, then:
If error in indicates an error, the VI ignores error code. If not, the VI tests it. A nonzero value signifies an error.
But my observation is that when error in indicates an error, the VI always shows a dialog even when given an error code. Instead, I am using the General Error Handler.vi and providing both an exception action (cancel error on match) and an exception code to get the behavior I want.
What am I misunderstanding?
Solved! Go to Solution.
12-06-2015 02:27 PM - edited 12-06-2015 02:30 PM
@MacNorth wrote:
I'm trying to understand the behavior of Simple Error Handler.vi, and it's confusing me because it doesn't appear to be correctly ignoring the error code I give it.
According to the documentation, if I provide an error code, then:
If error in indicates an error, the VI ignores error code. If not, the VI tests it. A nonzero value signifies an error.
But my observation is that when error in indicates an error, the VI always shows a dialog even when given an error code. Instead, I am using the General Error Handler.vi and providing both an exception action (cancel error on match) and an exception code to get the behavior I want.
What am I misunderstanding?
The first part of the documentation reads:
"Indicates whether an error occurred. If an error occurred, this VI returns a description of the error and optionally displays a dialog box." It's not too clear unless you think about it in terms of how LabVIEW reports its errors. Errors are written to the error cluster which, if you've been practing safe programming, is propagated throughout the application, so it makes sense that any error handler would look at that first. This is consistent with standard error out functionality.
edit:
I'm not sure why you have those indicators up. They are showing what I would expect them to be showing. ("An error occured" for the first two, "an error was cancelled out" for the third.)
12-06-2015 02:31 PM - last edited on 12-06-2015 02:47 PM by altenbach
@billko wrote:
PS - you don't need that sequence structure.
Actually here it is needed to make the popups appear in defined order. Without the sequence structure they could appear in random order and it would be hard to correlate the popups with a specific subVI instance. 😉
(Of course we could force a defined execution order by sequecning along the error cluster instead of branching it. ;))
12-06-2015 04:54 PM
MacNorth wrote:
I'm trying to understand the behavior of Simple Error Handler.vi, and it's confusing me because it doesn't appear to be correctly ignoring the error code I give it.
According to the documentation, if I provide an error code, then:
If error in indicates an error, the VI ignores error code. If not, the VI tests it. A nonzero value signifies an error.
But my observation is that when error in indicates an error, the VI always shows a dialog even when given an error code.
There are two different ways to interpret ignore in the sentence: "If error in indicates an error, the VI ignores error code."
12-06-2015 06:38 PM - edited 12-06-2015 06:39 PM
@billko wrote:
@billko wrote:
PS - you don't need that sequence structure.Actually here it is needed to make the popups appear in defined order. Without the sequence structure they could appear in random order and it would be hard to correlate the popups with a specific subVI instance. 😉
(Of course we could force a defined execution order by sequecning along the error cluster instead of branching it. ;))
Oh I didn't even think about popups because I almost always supress them! (I was just thinking about the indicators.)