LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need X/Y graph inside of While Loop

Hi Folks,

I have a data acquisition program running in a loop. It measures load and position for a hydraulic ram. I can graph load and position versus time on graphs in real time. However, I am unable to graph load versus position in real time, and I am stuck!

I've looked at the documentation and can't figure out how to do this. I am writing this data to a file each iteration of the while loop. Maybe I can read that file and graph it each iteration, but this seems like it would take too much time.

What I need is a graph that is persistent and can live inside the While loop, like those that graph waveforms. I need to graph load versus position. Any suggestions?
0 Kudos
Message 1 of 3
(2,725 Views)
The XY graph requires an x array and a y array. You could do it with a shift register and the build array function, get your arrays with each iteration of the while loop. I've shown that in the attachment. A better way if the app is run a long time and you need to limit the number of points plotted like the chart you're using, is to look at the shipping example called XY Chart. A subVI takes card of appending new data and removing data in excess of chart history size.
0 Kudos
Message 2 of 3
(2,725 Views)
Dennis,

Thanks very much. I was working on using shift registers but was not satisfied with that solution. However, I see in the example you reference that they use buffers in the example. That's what I am going to implement (tonight if the coffee holds out).

Thanks again!
Mike
0 Kudos
Message 3 of 3
(2,725 Views)