LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Plot data from a plot handle

If I have a plot panel and control and the plot handle, is there a way to acquire the plot data(points) from it?
0 Kudos
Message 1 of 3
(3,159 Views)
Sure: using GetPlotAttribute with ATTR_PLOT_XDATA and ATTR_PLT_YDATA permits you to retrieve X and Y data for the plot; another attribute (which I don't remember now) permits to retrieve the number of points in the plot (or the number of bytes if you prefere so) so hat you can dynamically allocate memory if you need to.
These attributes are not valid for all plot types: I am sure they can be used for XY and waveform plots, look in the online documentation for further details.


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 2 of 3
(3,151 Views)
I am now on a PC with CVI so I can detail a little bit more this item. ATTR_PLOT_XDATA_TYPE / ATTR_PLOT_YDATA_TYPE attributes give you informations about the type of data in the axes, while ATTR_PLOT_XDATA_SIZE / ATTR_PLOT_YDATA_SIZE inform you of the size in bytes of the data in the 2 axes so that you can determine the type and size of memory to allocate for each of them. Supposing you already know these informations, which is most likely your situation, ATTR_NUM_POINTS returns only the dimension of the plot in array elements.
I can confirm you that these attributes only apply to X, Y, XY and waveform plots, with the addition of polygon plots.
 
You cannot access plot data if graph data mode is set to Discard (plot functions do not return a valid plot handles in this case).


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?
Message 3 of 3
(3,142 Views)