LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

keyboard

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

0 Kudos
Message 1 of 4
(2,690 Views)

Hi,

 

here is an another way

 

Hope it helps.

 

-Amit

-
Amit
CLAD
Download All
0 Kudos
Message 2 of 4
(2,658 Views)

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.

0 Kudos
Message 3 of 4
(2,644 Views)

The best solution here is to not have the event structure in the case structure at all.  It should be in its own looop.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 4
(2,630 Views)