06-05-2015 02:09 AM
Hello everyone,
I am using an event structure that recognizes when I press a button from the keyboard.
This event structure is inside a case structure and the problem arises when there is an input from the keyboard and the program is excecuting somewhere outside the case stucture. When this happens, the VI freezes and I must forze quit.
I tried moving the event structure outside the case structure without any success. So...
I need to find a way to recognize a button pressed from keyboard without using an Event Structure.
Any suggestions?
Thankyou
Lorenzo
06-05-2015 04:26 AM
Hi,
here is an another way
Hope it helps.
-Amit
06-05-2015 05:00 AM
Can't read the VIs here, so apologies if I am repeating the method given by the first responder.
Generally speaking, you have to keep your event loop spinning or the system will freeze when it can't process a GUI event. One of the best architectures for getting around this is to have your event case sending messages into a queue, where another loop can respond and do the major processing. Short, quick, one-shot functions can still be executed directly within the keyboard event case or containing loop if this simplifies things.
06-05-2015 05:52 AM
The best solution here is to not have the event structure in the case structure at all. It should be in its own looop.