LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Plots with Single XY Graph ??

I am trying to plot multiple plots on a single XY Graph. In particular, I am trying to plot two thermocouple temps over time. I will be acquiring and recording the data at a rate of 100 Hz, but I only need to display it to the screen at a much slower rate.

I have made and attached a simplified VI of what I am trying to accomplish. The random numbers in my example represent data that I am acquiring at a rate of 100 Hz. I want to be able to control the ploting rate (say 1 data point per second) with a Control on my front panel. I am having a problem setting up the plot to do this. As it is written now the plot jumps around between the two Y values.

Any ideas as to how I could do this??

Thanks,
Michael J Fidler
Download All
0 Kudos
Message 1 of 6
(6,424 Views)
Have you taken a look in the labview examples, I think that looking at XY Multi Plot.vi will be beneficial to you.

Cheers!
Message 2 of 6
(6,407 Views)
Thanks for your reply, jmcbee. Yes, I have looked at many examples in the NI Example Finder. However, the VI you refer to, "XY Multi Plot.vi", only plots full sets of data a single time. I agree it is quite trivial to plot multiple plots of data sets on a single XY Graph. I, on the other hand, am trying to append to an existing XY graph in real-time at a user-controlled rate set by a control on the front panel. In my situation, I don't have arrays of full data sets to plot, I have single values that I am trying to append to an existing XY Graph. When I try to do this, either the plot keeps reseting every loop or the plot draws lines between the two y sets.

Thanks for your time,
Michael J Fidler

ps. Somehow I posted the same VI twice above. They are identical.


Message Edited by Michael Fidler on 11-29-2007 08:42 AM
0 Kudos
Message 3 of 6
(6,382 Views)
What you are seeing is by design, as that's how the XY Graph works. The Chart, on the other hand, will do what you want. Perhaps you can use that, especially if your points are equally spaced. If you have to use an XY Graph the only way to do what you want is to use a Build Array to append to the X/Y array in the XY Graph data. You can get the current XY Graph data either via a local variable or a property node.
0 Kudos
Message 4 of 6
(6,372 Views)
Your XY graph has multiple plots, when you are appending data, are you adding points to all the plots at once? Or do you only have values to append to certain plots?
 
If you dont want the array to clear, use a loop and a shift register to store your plots. If a line is being drawn between the two plots, it could be because you are adding points to the wrong plot.
Jeff


Using Labview 7 Express
0 Kudos
Message 5 of 6
(6,368 Views)
Here is a modification of your VI that will update an XY Graph point by point. There is also a shipping example called XY Chart that can be used. The advantage of the XY Chart is that there is a buffer similar to the regular chart's history property. With the shift register method, the array will grow and grow and performance will suffer.
Message 6 of 6
(6,364 Views)