LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I plot multiple curves using the XY graph?

Hai,
I want to plot  XY graphs for 2 diffrent datas in a single XY graph , to compare both the graphs, how to do. i attached my file & vi
 
thanks
sasi  
0 Kudos
Message 1 of 33
(106,422 Views)
You may simply use "Build Array" VI. The attached VI shows how to plot two curves in a single XY graph for your reference.
Message 2 of 33
(106,415 Views)
Also check the help for an XY graph control. It will show you exactly how to do it. A single plot is a cluster containing an array of x values and an array of y values. A multiplot graph is simply an array of clusters with that structure.
 
Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 3 of 33
(106,410 Views)

Is it possible to plot in any way not using this stucture?

Now I plot using:

X11,X12,X13,X14....

Y1_1,Y1_2,Y1_3,Y1_4...

X1_1,X1_2,X1_3,X1_4...

Y2_1,Y2_2,Y2_3,Y2_4...

...

X1_1,X1_2,X1_3,X1_4...

Y32_1,Y32_2,Y32_3,Y32_4...

but I would like to use:

X1_1,X1_2,X1_3,X1_4...

Y1_1,Y1_2,Y1_3,Y1_4...

Y2_1,Y2_2,Y2_3,Y2_4...

...

Y32_1,Y32_2,Y32_3,Y32_4...

 

This to save memory, since the arrays can have a length of ~80000 values, and just for plotting would mean I have to 'save' the same x-data 32times. The delta-x is not uniform, but can vary over time,  therefore I cannot use anything other than XYgraph (?). (array is stored and then the entire cluster fed into XYgraph each iteration) Samples are however taken on all channels at the same time, so no independent x-values.

 

values are now double, but I'm looking what the impact would be if I convert to single. Xvalues are relative timereferences.

 

/Anders



Message Edited by Tohatsu on 01-21-2008 09:30 AM

Message Edited by Tohatsu on 01-21-2008 09:31 AM
0 Kudos
Message 4 of 33
(106,122 Views)
Hi Tohatsu,
To answer your question about converting data to single, you would use half the space in memory but your values would also have half the accuracy.  Double data types are 64bit and single data types are 32bit.  Also, even though your data is contained in a 2D array you can still use a waveform chart.  When you use a waveform chart you do not have to send all your data every time because the chart has a buffer.  Look through the LabVIEW examples to help explain the differences between the two. 
Eric A.
National Instruments
Distributed I/O Product Support Engineer
0 Kudos
Message 5 of 33
(106,097 Views)
Okay...so if I descide on rewiring my layout and not saving the entire array, how big is the buffer? because I want to be able to see the whole graph and be able to zoom and return to full view during runtime (possible right now).
 
Also, you mentioned I could plot the 2D data directly? without adding timestamps to each Y-value? Will it only buffer one timestamp instead of my solution right now that saves as many timestams as I have channels in an array? Maybe the best would be to keep my value-array and then just add timestamps to the last values and then pass it to the XYgraph? If the buffer can handle that many values that is.
 
If I were to abandon buffering the entire array (would be real nice indeed, since it frees up a lot of memory), I then need something to call on excel to import my semicolon separated textfile at the end. (textfile logged separatly) Right now I just call a new sheet and insert my array values.
 
(look at last 2 frames of VI)
0 Kudos
Message 6 of 33
(106,081 Views)
with the waveform charts as you suggest, is it possible to include x-data? because as I said, my values are not evenly distributed over time but the spacing do vary. As far as I can tell, the waveform can only handle a fixed delta-t between values?
 
Anders



Message Edited by Tohatsu on 01-24-2008 05:36 AM
Message 7 of 33
(106,074 Views)
Hi,
I apologize for the earlier post.  If you want to display a two diminensional array of points then you will need to use the xy graph.  You should be able to create a buffer in your LabVIEW program to make the xy graph behave like the waveform chart in that it would show historical data.  I also submitted a product suggestion over this behavior.  Let us knowif you would like an example of how to create the "buffer" for your chart.
Eric A.
National Instruments
Distributed I/O Product Support Engineer
0 Kudos
Message 8 of 33
(106,034 Views)

hey,

 

I have a hobby of playing labview.

 

I make a circuit which makes both voltage and current. DAQ is connnected both source and it is sensing both DC current and voltage by single DAQ.

I plotted graph also but it is a single point ...i need a long plot graphical line according to my time requirement and then later on printing the specified data or spreedsheet from graph.

0 Kudos
Message 9 of 33
(103,226 Views)

Hi Everyone,

 

I am attempting to build a multi-plot XY graph.  I have looked at many examples and spent quite a bit of time to try and make this work.  Attached below is a screen shot of the architecture (from Labview examples) I finally got to plot both data streams. However, now the graph will only plot the last point for each stream. It clears all previous data from the graph, this is not what I need. I was not able to get the Express XY graph to plot multiple streams.  I noticed when you right click on the Express VI you get a dialogue box with a "Clear data on each call" option.  Is there a similar option somewhere so that my graph will keep the previous data?  Thank you for you help.

 

Regards,

PChemist

 

P.S. I am using Labview 8.0

 

 

Multiplot VI.JPG

 

 

0 Kudos
Message 10 of 33
(102,528 Views)