06-04-2012 04:30 AM
I have a while loop that continuously acquires data from an usrp for 100ms and puts it into a buffer (which is the output from the while loop).
The problem is that the while loop is continoulsy running and I need to acquire the output data every 100ms to be processed, and after 100ms
I need the while loop to output new data.
How might I accomplish this?
06-04-2012 04:37 AM
If your processing takes too long to be done inside your acquisition loop you will need to have a second loop and pass data from the acquisition loop to the processing loop using a queue.
Look up producer/consumer pattern on the forums (here) or on the NI community (community.ni.com) there are lots of examples and discussions about that, you probably even have examples of that inside LabVIEW, which version do you have?
Hope this helps
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
06-04-2012 04:42 AM
I have version 11.
I was looking for a simple solution: is there a way I can set the while loop to run for 100ms, then output, then wait for 0.5s, then run again for 100ms, then output, then wait for 0.5s etc?
I think this would solve my problem...
Thanks for responding so fast!
06-04-2012 04:49 AM
Can you post a screenshot of your while loop, I'm pretty sure we can find a simple solution for you but I'd like to see where we're starting from.
Trying to help
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
06-04-2012 05:13 AM
Sorry, I cannot post the code since it is part of a project and there are other people's work involved...
Anyway, I wanted to know if it is possible to set a while loop to continuously output data while it execute, not only when it finishes.
Thanks!
06-04-2012 05:29 AM
I was not asking for you to post the whole code, but just a screenshot of the while loop in order to be able to provide meaningful help.
Maybe what you need is a while loop inside a while loop.
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
06-04-2012 05:38 AM
I will try using a queue. Thanks for the help!