LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

keystroke freezes front panel

I'm getting some weird behavior with my VI. If anyone has time to give it a quick look over, it would be much appreciated.

when the vi starts, I put in a while loop to wait for the user to hit a "start trial" (I also tried a keydown event case and this problem was still there). . . this is so that the user can change the default values in some of the controls, should they want to, before the real program begins.
however, during this time, if ANY key is hit on the keyboard (other than "return", which is set to toggle the "start trial" button), including modifiers like shift or control, the front panel freezes and will no longer let the user change values in the string controls, click on the "start" button, or hit enter to end the loop and begin the trial.

when I copy and paste just the first sequence structure that contains the troublesome section, the problem goes away, so it must have something to do with other parts of the VI as well.

the VI (once the start button is pressed) is designed to detect keystrokes (default: "n" "m" and Space bar) to start and pause two different timers, and then to quit when a certain cumulative time is reached.
0 Kudos
Message 1 of 8
(3,676 Views)
We would love to look it over, if it were only attached ;).  my gut says you have another event structure in use somewhere.... but will either I or someone else will look when you post it.

Paul
0 Kudos
Message 2 of 8
(3,673 Views)
hahaha. . . I thought I had attached it. my bad.
0 Kudos
Message 3 of 8
(3,668 Views)
i do have another event structure in use, but it is in the next frame of the sequence structure... could that still be it?
0 Kudos
Message 4 of 8
(3,667 Views)
It is indeed your event structure.  You can fix it quickly by editing the events for your key down event and uncheck the box to lock front panel activity.  That fixed your problem for me.  It continued to work after I turned it back on.
0 Kudos
Message 5 of 8
(3,661 Views)
just to experiment, I took out the event structure later in the VI (which completely breaks the functionality of the program). sure enough, it no longer freezes when I hit a key before hitting the "start trial" button.
but I need that event structure in there later... so how do I get around that problem?
0 Kudos
Message 6 of 8
(3,659 Views)
YES! I love you.
thanks matthew . . . I had never noticed that checkbox there before. that was a good lesson to learn.
0 Kudos
Message 7 of 8
(3,658 Views)
You are operating under a misconception about event structures. An event structure is always capturing events. It does not wait until you call it in a sequence structure. You should avoid having multiple event structures in a single VI unless you are very careful and know exactly what you are doing. Having sequence structures in a VI is another thing that should be avoided as well.
0 Kudos
Message 8 of 8
(3,641 Views)