Jump to content

How to manage an error without stopping the vi


Recommended Posts

Hi folks,

Just a question related to a vi I'm playing these days, hope you will be able to point me in the right direcction.

The vi is basically a For Loop which iterates several times, once per I.P connection, because inside the for loop I executed some telnet commands against some machines outside and log the results.

The key, and this is my question, is that sometimes and for whatever reason these I.P's are unreacheble so automatically Telnet vi's, from Internet toolkit, are not very happy about this and the error propagates through the different error cluster Telnet vi's and at the end there is a pop up message just with the code of the error and so on, although I get and copy the error through the Simple Error Handle vi, the error message pops up, please see attached file, and I have to press Continue button in order to go on and I'd like to avoid this pop up because the vi would have to run automatically, so in case there were those kind of problems the vi will log the error message and will jump to the next I.P.

Any feedback will be welcome. :worship:

Kind regards.

Jose.

post-662-1164985190.jpg?width=400

Link to comment
I have a small utility VI that allows me to trap a particular error and handle it silently. Here's a screenshot and the VI compiled for LabVIEW 8.0:

post-3106-1164988539.png?width=400

post-3106-1164988524.png?width=400

Download File:post-3106-1164988495.vi

I don't know if clearing the error is the use case described. What you really want to do is log errors to file ... so if you clear the error, you've lost the info you need to log. Instead of using the code as it is presented here (an error filter), I would simply add some logic to write the error code, source and time to a log file (ie build an error log). You may or may not want to log all errors --> so you may or may not need to input the error code. If you want to log all errors, you can place your error log function in the Error case of a case structure. After writing the error to file you can clear the error by using the Clear Errors.vi on the Time & Dialog palette and your loop can keep on truckn'.

Link to comment
I don't know if clearing the error is the use case described. What you really want to do is log errors to file ... so if you clear the error, you've lost the info you need to log. Instead of using the code as it is presented here (an error filter), I would simply add some logic to write the error code, source and time to a log file (ie build an error log). You may or may not want to log all errors --> so you may or may not need to input the error code. If you want to log all errors, you can place your error log function in the Error case of a case structure. After writing the error to file you can clear the error by using the Clear Errors.vi on the Time & Dialog palette and your loop can keep on truckn'.

Take a look at the General Error Handler.vi. In and among its inputs is the ability to filter the wire value but still output the formatted string of the error so you can dump it to a log file.

Link to comment
Take a look at the General Error Handler.vi. In and among its inputs is the ability to filter the wire value but still output the formatted string of the error so you can dump it to a log file.

Yep. I have to agree that using the built-in exception handling of the General Error Handler.vi is the way to go. My little VI is not needed.

post-3106-1165008335.png?width=400

Link to comment

Hi everybody,

first of all, thanks for all of you not only for your valuable answers but also for pointing me out the right direction.

By reading your answers I have tried to catch the error I wanted to manage, error code 56 related to networking, just by using General Error Handler.vi, please see attached image file. The question is that it doesn

Link to comment
Any feedback will be welcome.

Thanks again.

Jose.

Remove the string "This is a test".

The general error handler requires a match of both code and source, if they are specified.

Edit: you should also set the "type of dialog" to "no dialog", if you only want to cancel error 56. Otherwise you will get dialogs for all other errors.

/J

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.