From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to send continuos waveform out of while loop

Actually I have to first stimulate a sinusoidal signal merged with noise, then I have to extract the approximate sinusoidal waveform removing the noise with the help of a FIR filter  . Then I have to do some processing on this output waveform of FIR filter, for that I want this waveform outside the while loop , but in the waveform graph I have connected outside the while loop , it is showing nothing . Kindly tell how to get that output waveform continuously ..... I have attached my VI in this message. 

0 Kudos
Message 1 of 5
(2,108 Views)

First, take some LabVIEW tutorials.  If you do, you'll learn about dataflow.  You can't just wire something outside of the loop.  Dataflow principles dictate that data the while loop and anything inside of it must complete execution before the data will flow out of its tunnels to the next node.  (The other principle is that something can't execute until it has all the data available at its inputs.)


LabVIEW Introduction Course - Three Hours
Learn LabVIEW

 

To send data outside of the while loop while it is still running, you can use queues in a producer/consumer architecture.  (Search the forums or google it.  There are examples within LabVIEW help as well.)

 

There is also a relatively new feature in LabVIEW called channels that does effectively break the tunnel dataflow dependency.  I've never used them myself.

0 Kudos
Message 2 of 5
(2,093 Views)

When the loop is running, you cannot take any data outside directly. Waveform data will be available outside only when the loop is stopped.

Solution:

1. You have to process the waveform data within the loop itself. OR

2. You can process the waveform in another loop using Queues. (Enqueue and Dequeue element functions)

 

I have attached a simple Queue example. In this example, Numeric datatype element is used, instead you have to use waveform datatype.

0 Kudos
Message 3 of 5
(2,087 Views)

@phoenix-karthik wrote:

When the loop is running, you cannot take any data outside directly. Waveform data will be available outside only when the loop is stopped.  This statement is wrong, as noted in Solution #2.  RavensFan also mentions Channel Wires (which he hasn't use, but which I use a lot).  .

Solution:

1. You have to process the waveform data within the loop itself. OR

2. You can process the waveform in another loop using Queues. (Enqueue and Dequeue element functions)

 

I have attached a simple Queue example. In this example, Numeric datatype element is used, instead you have to use waveform datatype.


RavensFan has the correct "solution" -- you need to learn enough LabVIEW to (a) understand the Principle of Data Flow (which the previous Poster over-simplified by saying "you can't take data outside a loop while it is running") and (b) are ready to learn more advance techniques, such as how to use parallel loops (which arise out of the Principle of Data Flow) and how to communicate between them.  What you are looking for is something called the Producer/Consumer Design Pattern, which you should look up when you have a little more LabVIEW under your belt.

 

Bob Schor

0 Kudos
Message 4 of 5
(2,077 Views)

Dear Bob Schor sir,

 

I knew that. Since Topic Poster is new to LabVIEW. I explained him step by step.

0 Kudos
Message 5 of 5
(2,068 Views)