LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

while loop timed output

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?

0 Kudos
Message 1 of 7
(2,515 Views)

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

Antoine Chalons

0 Kudos
Message 2 of 7
(2,513 Views)

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!

0 Kudos
Message 3 of 7
(2,510 Views)

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

Antoine Chalons

0 Kudos
Message 4 of 7
(2,503 Views)

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!

0 Kudos
Message 5 of 7
(2,497 Views)

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

Antoine Chalons

0 Kudos
Message 6 of 7
(2,493 Views)

I will try using a queue. Thanks for the help!

0 Kudos
Message 7 of 7
(2,490 Views)