LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plot X-Y graph with multiple y values on same x axis

Solved!
Go to solution

Dear all,

 

I have written some vi on a small part of my application. Basically, every 20 sec, I will acquire a set of readings (array) consisting of 10 data points known as T1. So at every timestamp, there should be 10 datapoints plotted on the same timestamp. Then 10 sec later, another timestamp with again 10 datapoints. I wanted the data to be plotted and updated every 20 sec and continue till I stop the program. At the end, I hope to see 10 horizontal lines.

 

I face some problems now and hope someone can help me on this? The problems are how do I plot the 10 datapoints at every interval of 20 sec. How do I also keep on updating the data? I know I need to build arrays but I am not sure how to do it.

 

Someone who knows please kindly help me on this as I have been trying but to no avail.

0 Kudos
Message 1 of 7
(8,279 Views)

Here is one way to do it:

 

XY.PNG

 

By transposing the array, the second for loop indexes by the plot# instead of by the timestamp.  Then you just bundle the plot data with the array of timestamps.

Message Edited by vt92 on 04-13-2010 08:24 AM
>

"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
0 Kudos
Message 2 of 7
(8,256 Views)

Dear All,

 

I have tried the program again. But there is still some problems.

 

How do i create the time interval of plotting the 10 datapoints every 20 sec interval. Meaning how i plot 10 datapoints at one timestamp and another 10 datapoints another 20 sec later? 

 

Right now, the x-y graph will refresh itself after 10 loops. However i also want to keep the previous datapoints in the previous timestamps also. How do i modify the program as i think i need to use build array function and shift register somewhere.

 

Can anyone assist me on that? Thanks! 

0 Kudos
Message 3 of 7
(8,234 Views)

Dear All,

 

I have tried the program again. But there is still some problems.

 

How do i create the time interval of plotting the 10 datapoints every 20 sec interval. Meaning how can i plot 10 datapoints at one timestamp and another 10 datapoints another 20 sec later?  Right now it seems that if i introduce a delay of 2 sec, the graph will be plotted 2x10= 20 sec later. However i want the scan rate to be 20 sec. If i set the delay at 20sec, then i will have to wait for 20x10=200 sec right? Is there a way to make it plot every 20 sec interval interval but not 2 sec scanning rate?

 

Right now, the x-y graph will refresh itself after 10 loops. However i also want to keep the previous datapoints (plots) in the previous timestamps also and it should be continuing since i started the program . How do i modify the program as i think i need to use build array function and shift register somewhere.

 

Can anyone assist me on that? Thanks! 

Kudos!
0 Kudos
Message 4 of 7
(8,226 Views)

First try to understand how data is stored in XY graphs, there are 2 different ways a) array of clusters and b) cluster of arrays. Depending on how you get the data you beter use a or b. Since you get 1 point at the time (every 10 sec) you should use method a.

 

Then, there is an exemple called XY Chart, use this one as a start and set the "Chart history size" to 2 since you want to view only 2 points a the time. If in a later stadium you want to see more points, just change that value and all will continue to work.

 

If after modifying it, something doesnt work, post what you tried and we can help you further.

0 Kudos
Message 5 of 7
(8,214 Views)

Is the attached screenshot what you want or should each of the 10 points get a different colour?

I used only 2 sec between 2 sets of 10 datapoints instead of 20 (couldn't wait that long :))

0 Kudos
Message 6 of 7
(8,207 Views)
Solution
Accepted by topic author Joven
I think it's easier with a chart, but if you want to use the XY, then this is the idea, just the idea.
Rodrigo Cuenca
www.cidesi.com

0 Kudos
Message 7 of 7
(8,197 Views)