LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can we get continuous output from two while loops

Hi,
 
    I've a problem with plotting a graph.Actually i've two while loops and i need a graph which requires one ouput from one loop and another output from another loop.I need that to be continuous. when i give graph outside both the loops, i'm getting only one point as output and so i'm not able to get graph. Can anyone help me out with this.Thank you.
0 Kudos
Message 1 of 5
(3,423 Views)
You can use queues to communicate between the loops (or local/global variables, but those are probably not the best solution).  Have the graph in on of the loops, and use a queue to obtain the data from the other loop.  The shipping examples of queue's should help you out if you haven't used them before.

The reason why you only got one point is because you probably just had loop tunnels (not indexed) leading out of your loops, and thus only the last data point collected was outputted.

EDIT: It occurred to me that queues might be somewhat problematic, depending on what you're graphing.  Which type of graph/chart are you using?  What kind of data is it seeing?  The only issue may lay in generating huge queues if you're logging a lot of data.  The type of indicator you're using is somewhat important.

Message Edited by Novatron on 07-10-2006 11:02 AM

Message 2 of 5
(3,415 Views)

hi,

I'm using XY graph and it gets the numeric data. The program interfaces with two instruments(pH meter and Syringe pump).we get pH from pH meter and Volume from syringe pump.I should plot the graph from those two values.I'm attaching my vi here. i would appreciate  if you can help me solving.

0 Kudos
Message 3 of 5
(3,409 Views)

Dataflow dictates that the graph cannot execute until both while loops have finished.

If you only want see the full graph AFTER the loops have finished, leave everything as is, but right-click on the two output tunnels of the while loops and enable indexing. Still, there could be problems because the loops are not syncronized. You might get more data from one loop than from the other.

If both loops should output the same amount of data, maybe you sould put everything inside one single  loop instead?

To see the graph built while the loops are running, You need to place the graph inside one of the loops and grab the "other" value via e.g. a local variable. (Also disable "clear with each call" on the xy graph express VI).

Sorry, I don't have any NI-DAQ installed, but what determines the loop time of the upper loop?

Message 4 of 5
(3,395 Views)
i got it running, Thanks a lot for ur help....
Kranthi
0 Kudos
Message 5 of 5
(3,388 Views)