LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to plot point by point using XY Graph and get multiplots?

I have a vi that can get multiple plots using XY Graph, but it does not update point by point. It waits until all of the data has been acquired and then plots.

 

I have another vi that can plot point by point, but it connects multiple plots. It connects the end of one plot to the beginning of another plot. So, you can tell that there are multiple plots, but you see a straight line going from the end of the previous plot to the start of the next plot. 

 

I'd like to plot signals as they are acquired and get multiple plots.

0 Kudos
Message 1 of 8
(4,216 Views)

My first guess is. that you should have a look at the labview examples abiut the XY-Graph.

 

Have a look at the attached vi. This should explain the behaviour you described. 

 

Best regards,

 

Balze 

 

P.S.: It's a LV 7.1.1 VI , you didn't mention which version you are using. 

 

Download All
Message 2 of 8
(4,198 Views)

Balze's got it: shift registers.

Chris Bolin
LabVIEW Partner Program, CLA
Message 3 of 8
(4,178 Views)

I finally got a chance to take a look at your vi. I should have been more detailed in my explanation.

 

I want to generate one plot in one execution of the for loop, but in the next execution of the for loop I would like the previous plot to remain on the XY graph and draw the new plot point by point. Shift registers give me a plot while the for loop executes, but then erases the previous plot and begins drawing the new plot.

 

I gues the question is, how to build mulitple plots (one at each for loop execution) implementing an XY graph?  

0 Kudos
Message 4 of 8
(4,159 Views)
Same concept. You need to send an array of clusters to the XY graph. You need two elements of the array since you want two plots. Each cluster is a plot, consisting of an X array and a Y array. The first element is generated in the first iteration of the loop. The second element is empty. In subsequent iterations you fill up the second element of the array of plots. Attached is a crude example (LV 8.0) just to show the concept. I'm not sure why you're using a for-loop, but I implemented it that way.
0 Kudos
Message 5 of 8
(4,150 Views)

JoelGR wrote:

I'd like to plot signals as they are acquired and get multiple plots.


Also, if you use the express XY graph, you'll get the "built xy graph" tool that can be configured to retain a history, simply uncheck "clear data on each call".

 

Of course this would need to go inside the acquisition loop.

 

 

0 Kudos
Message 6 of 8
(4,131 Views)

JoelGR wrote:

I have a vi that can get multiple plots using XY Graph, but it does not update point by point. It waits until all of the data has been acquired and then plots.


 


JoelGR wrote:

I have another vi that can plot point by point, but it connects multiple plots. It connects the end of one plot to the beginning of another plot. So, you can tell that there are multiple plots, but you see a straight line going from the end of the previous plot to the start of the next plot. 


 

As pointed out, both problems have quite a few easy solutions.

 

It would really be useful for us if you could attach two simplified examples for these two scenarios so we can see what you are doing. Maybe you are doing things way too complicated.

 

LabVIEW never connects multiple plots, so if you see a "connection", it means that you concatenate all data into one plot by mistake.

 

Is the data is spaced equally in x?

0 Kudos
Message 7 of 8
(4,129 Views)

I apologize for my tardy response. Thanks for your help. It was sufficient to point me in the right direction. I took the liberty of modifying the vi you sent me to illustrate the basic method I implemented. Hopefully, its helpful to other new comers to LabVIEW.

 

Thanks again.

 

Best,

Joel

0 Kudos
Message 8 of 8
(4,024 Views)