LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Output each iteration of while loop without enabling "indexing"?

Hello,
I'm making a VI which constantly 'listens' to a radio frequency input by putting wiring the input to a Fourier transform function inside a while loop. This loop has to be continuously running, but when the frequencies match a given set of criteria, the program needs to do other things while the loop continues to run. I have the frequency-matching criteria inside the loop wired to a Boolean indicator. Is there any way of getting the boolean value out of the loop each time it iterates so the other part of the program can execute? If the output waits until the loop is stopped the program won't work correctly. I have attached the initial version of the vi, and thanks for anyone's help!
0 Kudos
Message 1 of 3
(2,790 Views)
This is a good time for a queue, I think--see the Advanced >> Synchronization palette. You can set up a parallel While Loop that monitors the queue, and you can enqueue elements--passing arbitrary information such as frequency, amplitude, or whatever you like--when the proper conditions arise with the audio signal. The queue will also help ensure that you don't miss any trigger events if the secondary loop happens to be in the middle of processing one event when the next one occurs.

I modified your example and attached it here to demonstrate. I also had some fun singing into my microphone to achieve the signal conditions that you programmed in--falsetto was required!

Good luck,
John
Message 2 of 3
(2,782 Views)
Johnner,

That looks like it will work perfectly. Thanks a lot!
0 Kudos
Message 3 of 3
(2,755 Views)