LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sending info outside while loops

I've been staring at my computer screen for too long, so some of this may sound really stupid. I would like to get a chart to display on the front panel of my main vi. This chart is actually part of a sub vi, one step lower in the hierarchy than my main vi. This chart is also inside a while loop. So, this while loop is creating issues in outputting the data for the chart on my main vi. There has got to be a way to tunnel under the while loop or something. When I try to wire things outside the loop, the vi will run, but no actual data is being received.

 

I have completed a few tutorials on subvi's, and the only distinction I can make between the tutorials and my code, is that I have a while loop.

 

0 Kudos
Message 1 of 7
(3,065 Views)

Attach a sample main and subVI so we can see exactly how you are trying to go about this.  Where is the while loop?  Is it in the subVI?  Is it running continuously?  How or when do you stop it?  Is the front panel of the subVI opened when called?

 

You can pass data out of while loops using local variables and queues.  You could also pass a reference to a control or indicator into the while loop and have the program update it using a property node that is wired to that reference wire.

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

You can look ath the solution in this thread.

 

http://forums.ni.com/ni/board/message?board.id=170&thread.id=433344

0 Kudos
Message 3 of 7
(3,059 Views)

You could use a producer consumer architecture

 

it is in labviews templates.

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 4 of 7
(3,036 Views)
How are you trying to get the data? Can you post a screen shot?
0 Kudos
Message 5 of 7
(3,014 Views)

So,

I've pasted my code into the producer/consumer templates and have gotten my main code to run. But I do not know how to utilize the queueing(?) aspect of the template to achieve what I really desire. I still want to get the chart data out of the while loop, so that I can make a subvi, and use it later. This coding is essentially the acquire/display aspects of the experiment, so I only need the chart to be displayed at highest level front panel. I can see that the queue/enqueue items are anticipating a certain element, that the coder determines. I know that I want my elements to compatible with a 2D array of singles. But Ireally don't how to proceed. My code is attached.

0 Kudos
Message 6 of 7
(2,965 Views)
You know you want to pass a 2-D array of singles.  That is what you will wire into the enqueue Element.  However, at the Obtain Queue you need to define that data type.  Click on a wire that is a 2-D single datatype and select Create Constant.  Wire that constant into the Datatype input of the obtain queue where you have a string constant going in right now.
0 Kudos
Message 7 of 7
(2,959 Views)