06-30-2010 06:44 AM
Hi all,
My VI stop responding when I press any special key. Try running my VI attached in this post. While the VI is running, press any arrow key, and you may find that the value of the indicator "Horizontal position" and "Vertical position" changes accordingly. However, once a special character key is press, such as the "Ctrl" key or "Caps Lock" key, the VI stop responding. Anyone can tell me how to avoid this?
Thanks..
Best regards,
Julianti
Solved! Go to Solution.
06-30-2010 07:11 AM
If you remove the generate fornt panel activity vi and remove the timeout on the event structure the vi works properly.
Why are you generating activity every time the loop iterates?
06-30-2010 08:36 AM
Hi aeastet,
Thanks for your time and suggestion. If I removed the constant to the Timeout terminal, the VI will not respond when I click the Stop Button using mouse without pressing the keyboard.
I would like to keep the "Wait for front panel activity" because there are actually some other functions for image processing (not included in the attached VI) in the While Loop.
Regards,
Julianti
06-30-2010 08:40 AM
I believe that the wait is what is causing the problem. I do not understand why the stop will not work but I will deferr to you that what you have done will work for that.
06-30-2010 08:43 AM
As I said replying to your other post, I agree with aeastet.
Infinite timeout in the Event Case will be equivalent with "Wait for front panel activity": of course you should add a case to handle also the "Stop" button, then everything will be fine.
Speaking about why your VI hangs when pressing ctrl... I don't know.
It's interesting to note that if you remove the "Key down" event you can press ctlr & c. without blocking the vi.
Marco
06-30-2010 08:47 AM
Hi aeastet,
Do you mean that we must not use "Wait for front panel activity" together with Even Structure?
Thanks.
Julianti
06-30-2010 08:53 AM
Yes, I would take it out all together. The event structure will wait until someone pushes a button or does something that you have an event setup for.
06-30-2010 08:54 AM
Also if you want to react to the stop button all you have to do is add the event. See the attached file.
06-30-2010 08:59 AM
You can also remove the "Lock front panel until event case completes" under edit events to prevent it from happening.
"Ctrl" input will not increase the loop itteration thou.
06-30-2010 09:22 AM - edited 06-30-2010 09:25 AM
Thank you to you all so much.... I have the VI working properly now.
Also, I learnt that Infinite timeout in the Event Case will be equivalent with "Wait for front panel activity". Thanks!!
Best regards,
Julianti