LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error message pop up stops code

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.

Download All
0 Kudos
Message 1 of 8
(3,256 Views)

This only occurs if the output is not connected to anything. Is there a way to suppress this behavior?

0 Kudos
Message 2 of 8
(3,247 Views)

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.

 



0 Kudos
Message 3 of 8
(3,243 Views)

"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

0 Kudos
Message 4 of 8
(3,235 Views)

@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!

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 5 of 8
(3,197 Views)

@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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 6 of 8
(3,190 Views)

@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.

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 7 of 8
(3,182 Views)

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:

Errortest_BD.png

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: YoutubeCentre of Excellence moduleforum with presentation files.

The PDF on the last link has a nice poster-style description.


GCentral
Message 8 of 8
(3,140 Views)