LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

exit event and fft

Hi,

I have an event "scan" triggered by a button, which uses a while loop to get data and display them on the screen. Is it possible to exit the while loop if a key on the keyboard is pressed, and then implement the "key down" event? If so, how to achieve that?

Also, the frequency always shift around 6khz when I do the fft (sampling at 100mhz, and doing 16k fft). It seems the fft subvi miss count a point (50mhz/8192). Am I right? Thanks in advance!
0 Kudos
Message 1 of 3
(2,600 Views)
If the loop is inside the event structure, you don't need an event to stop it. Just place the terminal of the stop button inside the while loop and "boolean or" it to the existing termination condition. The loop will stop if either goes true (assumes loop is set to stop if true).

The FFT does not shift anything. Make sure you know the convention how the fft data is arranged. LabVIEW fft output is nyquist centered, beginning with the DC component. For even numbered arrays, the highest frequency shows up only once. If you still think something is wrong, please attach an example.
0 Kudos
Message 2 of 3
(2,600 Views)
Thank you for the answer! But I do need a key down event to stop the loop! We need to do the scan event quite often, and we don't want every time to click the stop button first, and then start other events (we use different keys to control machines). If there is a way labview can exit one event by calling other event life will be much easier:)

I'll double check my starting point of the data array. If it still doesn't work, I'll attach an example.

Thanks again!
0 Kudos
Message 3 of 3
(2,600 Views)