10-01-2012 11:11 AM
Hello all,
Here is the case, when I am using my system for long hours, there are times that I cannot be able to keep an eye on the measurements thats why I have created an error handling case structure which turns off my heaters and power supplies in any case of an error. However, that is not the case when there is an error message popping up which waits for the user input to click. I was wondering how I can control this error box and let the error handling take care of that when user is not around?
Thanks in advance.
10-01-2012 11:21 AM - edited 10-01-2012 11:22 AM
This depends. What are you using for the error popup? A one button dialog, the "display message to user" express VI? A custom dialog? The general error handler?
I would suggest using the "display message to user" because there is an option to "show or not show" the message. Just have the user click a checkbox on the front panel called "away" or something like that before he leaves. If this boolean is clicked, then choose not to show the error message. If it isn't checked, then show it the message.
You could also turn off the heaters BEFORE showing the message. Then if the message sits there, it doesn't matter because they have already been turned off. This way when the user comes in in the morning they will know there was an error. (or you could use an error log also). There's all sorts of options and it really depends on what you ultimately want, which will drive your decision.
10-01-2012 11:25 AM
What software architecture do you have? and how are you handling errors?
By default, LabVIEW automatically handles any error when a VI runs by suspending execution, highlighting the subVI or function where the error occurred, and displaying an error dialog box.
You should disable automatic error handling and handle the error yourself. If you have a state machine architecture, you could add an error case that you can transition to if an error occurs where you can deal with it.
Read this
10-01-2012 11:36 AM - edited 10-01-2012 11:37 AM
Thanks for the responses, they are very helpful.
I am attaching my screenshot for the error case structure I am using, error out 2 here is the error coming from the error out previous sub VI that was running. So I am not using error pop out windows, I just have 2 cases, If there is error, stop the Sub VI's which are heaters and power supplies and If there is no error then do nothing.
Problem is when there is an error pop out window, then this error case structure does not catch it as an error (when the pop up is open and the user did not give any input).
What should I do to make the error pop out windows send en error out to my case structure w/o removing the box so I can see what the error was in the morning as 'for(imstuck)' recommended.
Thanks,
10-01-2012 11:59 AM
If you have a standard LabVIEW error dialog popping up, that means you haven't handled all of your errors. Somewhere you have a VI that had an error coming out but isn't wired to anything else.
You need to find that spot and wire up that error wire to something, and handle it within you architecture in a way that makes sense.
10-01-2012 03:09 PM
One example of a VI which behaves as RavensFan suggests is the Write to Spreadsheet File.vi. It uses the pop up Error Handler VIs internally. Read from Spreadsheet File.vi is another culprit.
If you use those and decide to change them, be sure to save the modified files with a different name and in a location other than vi.lib.
Lynn
10-01-2012 03:25 PM
Dear johnsold,
There is a big possibility that error pop up is coming from the Write to spreadsheet VI. Cos yes, I am using such a VI and I am not sure If I want to replace it with something else cos it really works well at this moment .. Can I find a way to catch the error from write to spreadsheet with my error case handler w/o needing a user to respond?
10-01-2012 03:28 PM
It depends on what your error is. Do you know?
If it is something like a an error caused by and invalid filename or path, you could check if the filename is valid before passing it on to the Write to Spreadsheet file VI, then the error wouldn't occur.
10-01-2012 03:38 PM
I have a loop of measurements that is going on and I am updating the spreadsheet each time I get a measurement. so it works fine sometimes there is no error until the end of the measurement but in some cases an error pops out and luckily I was there at that time to catch it cos then the heaters remain at the constant current which might cause a problem If the measurement is at the maximum current when the error cccurs.
Some of the Sub Vi's have for loops inside and I can only monitor the error after the subvi is ended so I suspect when the error occurs in one of the loops in the sub vi - then it may yield to an pop up window? Maybe I should put the error case handlers inside the for loops of the sub vi's as well ?
10-01-2012 03:45 PM
As I said, it all depends on your architecture. You need to handle them where they occur, then decide what you need to do with it. That may mean breaking out of the subVI loops. Or passing the information to an error handling loop via a notifier.