04-11-2011 06:56 PM
Hi all,
I was wondering if there is a way to press "continue" button programmatically when an error massage pops up. In USB communication application, if an error occures because of disconnection of USB cable, in this case VISA would generate an error windows, I am working on an effect that when the user reconnect the USB cable to the system, the error massage would disappear automatically. Your ideas would be appreciated.
Thanks & Regards
Peter Huang
04-11-2011 08:53 PM
You are getting a popup because you either have automatic error handling turned (Tools>Options>Block Diagram) or you have the General Error Handler function in your code. So, the best way to fix your problem is to not have the popup displayed at all
04-11-2011 09:11 PM
Thanks for your reply, I think I didn't make myself clear enough. I mean in my application, We hope user to see a popo up warning if USB cable somehow accidently disconnected. But we hope it would automatically close by software condition say detecting the reconnection of USB. I am thinking a way to avoid the susppession of code execution when error dialog box comes up, so that my programme would wait and hold an error window until certain boolean condition is met, then finally close itself. So far, the information I found is simulating key stroke, another possible option is using invoke node with OK button as a control. Any other ideas?
04-11-2011 09:16 PM
You can't use the built-in LabVIEW error popups. You'll have to catch that error yourself and create your own subVI that pops up as an error dialog. When it runs, it stays open until the user hits a stop button on it, or the part of your main VI that detects the USB has been reconnected sends a message to it (global variable, action engine, queue, notifier) to tell it to stop running and close itself down.
04-11-2011 09:38 PM
Yes, I disabled Labview built-in auto error handle, trying to create my own error dialog. Thanks.
04-12-2011 05:24 AM
By it's nature an error dialogue will halt your code and stop it looking for the error condition to go away. Ravens Fan has the right answer for you, don't use the in-built functions, they don't actually give you what you want, a custom dialog would give you far more power.
04-12-2011 08:37 PM
To build my own dialog vi, I am still using build-in dialog message like "Display message to user". My problem is When I call this dialog subVi , my main VI code would still be susppended unless I press "OK" on the dialog. I tried to configure subvi execution system different from main vi, I thought by this way It would be run in different thread. but it doesn't help....
04-12-2011 09:23 PM
I found the information that I need here: http://forums.ni.com/t5/LabVIEW/dialog-with-no-user-interaction/m-p/1427548
04-12-2011 09:28 PM
also here:
http://digital.ni.com/public.nsf/allkb/EEBEBEF66704646986256FBA007635BD