10-31-2019 09:37 AM
Hello everyone,
I am trying to pass my custom error cluster, but the receiver always throws an popup error message. I need to work with the errorcluster (true, false) afterwards and do not want the user to have to quit manually.
Usually when an Error arrives I can pass them between VIs, but when I make one from a Constant an extra message pops up.
10-31-2019 09:43 AM
This only occurs if the output is not connected to anything. Is there a way to suppress this behavior?
10-31-2019 09:44 AM
Hi,
What are you trying to achieve?
The example you provided works as intended.
The error is generated in the subVI, passed to the Main VI and thrown as a message pop up.
Your Main VI is configured to "Enable automatic error handling" so it will always pops up a message when the error is not handled.
If you want to get rid of the error message pop up you can either disable the "Enable automatic error handling" in your Main VI, or handle the error. You can handle it by connecting error indicator, Simple Error Hanlder.vi, etc. There are plenty of possibilities.
10-31-2019 09:51 AM
"Enable automatic error handling" is too risky for me.
@pitol wrote:
Hi,
What are you trying to achieve?
The example you provided works as intended.
The error is generated in the subVI, passed to the Main VI and thrown as a message pop up.
Your Main VI is configured to "Enable automatic error handling" so it will always pops up a message when the error is not handled.
I will just connect the errorcluster somewhere.
Thanks for the tip
10-31-2019 11:02 AM
@s.h._tech wrote:
"Enable automatic error handling" is too risky for me.
@pitol wrote:
Hi,
What are you trying to achieve?
The example you provided works as intended.
The error is generated in the subVI, passed to the Main VI and thrown as a message pop up.
Your Main VI is configured to "Enable automatic error handling" so it will always pops up a message when the error is not handled.
I will just connect the errorcluster somewhere.
Thanks for the tip
You should always "connect the error cluster somewhere". This is a major way we control dataflow. There is the added advantage that it "encourages" you to handle all your errors - as you should be doing!
10-31-2019 11:31 AM
@billko wrote:
@s.h._tech wrote:
"Enable automatic error handling" is too risky for me.
@pitol wrote:
Hi,
What are you trying to achieve?
The example you provided works as intended.
The error is generated in the subVI, passed to the Main VI and thrown as a message pop up.
Your Main VI is configured to "Enable automatic error handling" so it will always pops up a message when the error is not handled.
I will just connect the errorcluster somewhere.
Thanks for the tip
You should always "connect the error cluster somewhere". This is a major way we control dataflow. There is the added advantage that it "encourages" you to handle all your errors - as you should be doing!
While this is generally true, I try to avoid adding error clusters to subVIs that will simply pass them through. For instance, subVIs that simply format strings, parse some data or similar VIs. I really try to avoid passing anything into a subVI if it will not actually be used within it.
10-31-2019 12:11 PM
@Mark_Yedinak wrote:
@billko wrote:
@s.h._tech wrote:
"Enable automatic error handling" is too risky for me.
@pitol wrote:
Hi,
What are you trying to achieve?
The example you provided works as intended.
The error is generated in the subVI, passed to the Main VI and thrown as a message pop up.
Your Main VI is configured to "Enable automatic error handling" so it will always pops up a message when the error is not handled.
I will just connect the errorcluster somewhere.
Thanks for the tip
You should always "connect the error cluster somewhere". This is a major way we control dataflow. There is the added advantage that it "encourages" you to handle all your errors - as you should be doing!
While this is generally true, I try to avoid adding error clusters to subVIs that will simply pass them through. For instance, subVIs that simply format strings, parse some data or similar VIs. I really try to avoid passing anything into a subVI if it will not actually be used within it.
Well, okay - I do the same thing IF the dataflow doesn't have to follow the main "chain" and the error cluster will not be used.
10-31-2019 11:40 PM
Much to my surprise, this example didn't pop up a window as I expected.
I carefully checked that the "Enable automatic error handling" was ticked (as I'd guessed it was based on the question, and as pitol explained).
I discovered that the Options page for LabVIEW, under the Block Diagram section (near the bottom) includes a checkbox for "Enable automatic error handling dialogs". Mine was unchecked.
So this is another place that can control the appearance of such dialog boxes.
However, to reiterate what pitol said, the intended behavior when "enable automatic error handling" is set true is that this box should appear when an error occurs and is not connected to something else.
This is the default in new VIs, for a new installation of LabVIEW. The aforementioned Options page (Tools > Options...) allows you to change the default for new VIs, and also to suppress these regardless of the setting (two different checkboxes).
VIs can also be customized on a case-by-case basis via the VI Properties (File > VI Properties, or Ctrl+i) on the Execution page (drop-down list).
A common way to ignore this type of error is the following:
Here you can see you don't need to do much to avoid the box - just connect the error to something. A Flat Sequence Structure also gives you a nice place to put a comment to explain, if you wish.
A detailed collection of error handling options can be found in Darren Nattinger's NI Week presentation here: Youtube, Centre of Excellence module, forum with presentation files.
The PDF on the last link has a nice poster-style description.