LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

If error do not stop

Hi, I am using a sub-vi that has mathscript inside. If the mathscript gets an error, I get a pop up window with continue or stop options, if I choose continue it pop ups again, if I choose stop it stops the whole program.

I am looking for a way in wich if this happens it just shows a red led indicator and the rest of the program continues to work

0 Kudos
Message 1 of 5
(4,625 Views)

Hello,

a possibility is to ignore the errors.

I provide you a link, where you can learn how to ignore a Specific errors in LabVIEW.
Please tell me if it was what you were looking for.

 

Regards,

James.

Greetings and Regards,
James
0 Kudos
Message 2 of 5
(4,620 Views)

Nope not exactly

I created a simplified example of what I want it to do, so if you run with the current values it will give you an error, and I want the error to happen, but not the way it happens.(If the values are not what my algorithm requires I want it to continue running and just display there was an error)

If the subvi has an error, I don't want the pop-up I want the led to turn on, and if you want a random number to continue being calculated in the side while the LED is on you can still do that....

 

I attach my example

0 Kudos
Message 3 of 5
(4,606 Views)

Hi,

 

So there are two things here. The first is your error pop-up. (By the way, I can't run the code because I'm missing some of your MATLAB functions, but it doesn't really matter). The second is disabling the PP case if you have an error.

 

1 - The error dialog is caused by you having enabled (it is the default option - probably you haven't seen it before?) Automatic Error Handling. To disable this (assuming you want to!) go to VI Properties, and under Execution there is a checkbox. The shortcut for VI Properties is Ctrl-I, if you didn't know. (I, not L).

 

2 - In order to prevent the same error immediately happening again, you need to not call the case with the error if you have an existing error. The simplest way for you to do this is to add a Shift Register to your While Loop (right click on the border) and wire your error outputs. Note that at present, your subVI doesn't have any inputs or outputs for Error Codes - you can change this by right clicking on the small yellow icons at the bottom of the MathScript node and selecting Create Control for the left and Create Indicator for the right.

 

Add these to your connector pane, then wire them into the shift register for the main VI. You can then choose not to execute if there is an error in this top part of your block diagram, for example by adding an additional case structure and wiring the error code to the selector (the question mark). This should create an Error / No Error case pair, with your current code inside the No Error case. Just wire the yellow error wire straight through the Error case.

 

You might additionally want to add a button to clear the error, if it can be only temporary - in that case, consider the Clear Error node (with another case structure) or alternatively a Select node with a default Error Constant (i.e. no error) wired to True and the existing wire going to false, with a boolean control.


GCentral
0 Kudos
Message 4 of 5
(4,586 Views)

Interesting that gets close to what I am looking for;(My example program is like just a 5% of my real program btw)

So for (1) I have to change the properties to not handle errors on  the VI or open the subVI and change it on the SUBVI's properties. (And yes you were right, I had never seen that option)

As for number (2) yes how could call off the swith on the case in case of error, and turn a led on just in case of error

PS: I attach the matlab codes, the pure pursuit works as long as you are in bounds of your path, that I have tested and Is awesome, I shared it on a post a couple of weeks ago.

0 Kudos
Message 5 of 5
(4,570 Views)