LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to replot an array using plotXY without creating a new plot?

Solved!
Go to solution

Ok, it makes sense.

Apart a possible typo in writing: I have expected that stress (the quantity driving the phenomenon) is on the X-axis, while strain (the effect, or derived quantity) is on the Y-axis.

 

You could consider to split your application in two parts: test execution and presentation of results.

  1. Test execution: in this phase you are applying an increasing load to the DUT; in this moment you could display stress figures only on a strip chart, witout need to deal with updating a graph or so. In the meanwhile you are accumulating acquired measures in arrays
  2. Presentation of results after the test ended: in this step you may hide the strip chart and disply a graph with the stress/strain diagram, plotted in one step only. You could also enable zooming and panning on the graph so that the user is able to enlarge interesting portions of the graph and study the phenomenon in detail
I am just thinking aloud to share some ideas: there are possibly as many opinions on how to develop such an application as programmers in the field!


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 11 of 14
(1,657 Views)

Hi querty,

 

I appreciate that you've probably sorted this out and moved on by now, but I've just come across the same issue, and hence found your post.  I've also found a way to do what you want fairly simply:

 

Retain the handle from your call to PlotXY.

When you are ready to update your plots, call:

 

SetPlotAttribute (hpanel, GRAPH, PlotHandle, ATTR_PLOT_XDATA, XDataArray);
SetPlotAttribute (hpanel, GRAPH, PlotHandle, ATTR_PLOT_YDATA, YDataArray);
RefreshGraph (hpanel, GRAPH);

 

XDataArray and YDataArray must be the same size and type as those used in your original plot.

 

Cheers

Crispie

 

 

Message 12 of 14
(1,484 Views)

Crispie,

 

Thanks for letting me know about your solution but I don't think it addresses the problem I was having. Your solution replaces an existing plot with another plot of the same size, I believe. But that's not what I was trying to do.

 

I was trying to extend an existing plot line with new data. For example, say you read 100 (x,y) data points from your data acquisition system. You plot these 100 points on a graph. You then read another 100 points from the data acquisition system. How do you use these 100 points to extend the existing plot? In other words,  how do you create a continuous line consisting of 200 points without storing all 200 points. Two plots are required to do this as far as I can tell.

 

Extending a plot is not what the graph designers had in mind evidently. They designed charts for that purpose. But there are valid reasons for extending plot lines on a graph, I believe. The "inch worm" approach discussed previously is a little strange but it seems to work without significant undesirable side effects.

 

thanks!

0 Kudos
Message 13 of 14
(1,474 Views)

Hi querty,

 

Ah - I hadn't quite appreciated what you were trying to achieve.

 

I have a similar issue with my application in that all the data I wish to plot isn't available instantly.  However, I've made my plot arrays large enough for the final plot, and I duplicate the last point, however many times are required to fill the array, so suppose I have 1000 points in my final array, and only 10 available at the start, I plot the last point 991 times.  A little wasteful, but it's working fine.

 

Cheers

Crispie

0 Kudos
Message 14 of 14
(1,457 Views)