LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Build Second Plot for XY Graph

Hi guys,

At the moment I am plotting some calculated XY values (viscosity of oil against temperature) in the initialisation stage of a program, as the program runs I am collecting measured viscosity and temperature and would like to plot a second 'measured' trace on the XY graph.

 

I've tried a few things with bundling multiple arrays although I'm not sure how to make this work without calculating all the viscosity values on each iteration.  Here is my code so far;

 

Calculated vs Measured.png

 

In the 'real' application the Temperature and Viscosity come from FPGA Reads.

 

Any and all help appreciated Smiley Very Happy  I'm thinking initialise the cluster with 4 elements and build from that.. although initialising it with 0,0 isn't correct (at 0 temp, viscosity will be over 6000 cSt)..

 

Thanks,

 

Pete

 


Regards,

Peter D

0 Kudos
Message 1 of 2
(2,574 Views)

You need to initialize the shift register with an array, not a single cluster. An array of clusters of X/Y values is what is used for multiple plots. Having context help on and hovering over the indicator shows you how to create multiple plots for an XY graph. There is also an example that ships with LabVIEW that shows this. Within the loop you'd be replacing/adding the new X/Y points.

 

The real question comes into whether the plot is more of a chart or a graph. In other words, do you have a fixed number of points to plot, or do you need to keep plotting as you collect data? Also, are you trying to actually trying to plot viscosity vs temperature, or is temperature a separate plot, and everything is plotted vs time? If you're doing viscosity vs temperature, then you could make use the XY Chart example that ships with LabVIEW. That uses a subVI that acts as a buffer for the data points.

0 Kudos
Message 2 of 2
(2,563 Views)