LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

simple plot use

Hi,
I'm trying to find basic plot functionality (Graph Control): add values to existing plot.
I saw a lot of examples, but all efforts are unsuccessfuly
 
Thanks
0 Kudos
Message 1 of 4
(3,244 Views)

You cannot simply add values to a plot in graph like you do in a strip chart: every plot is a full entity that cannot be modified. Instead, it can be accessed to retrieve its data so what you can do is (in case you don't have a copy of plotted values) use SetPlotAttribute to retrieve ATTR_PLOT_XDATA and ATTR_PLOT_YDATA in arrays (if you don't know the size of the plot use ATTR_PLOT_XDATA_SIZE to determine the number of elements in the plot depending on the byte size and the type of data, next dimension the arrays to store data in). next you can add values directly to the arrays, delete old plot and draw the new one.

Look at the example attached (it answers also to your other problems regarding tables).

Roberto



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 2 of 4
(3,237 Views)
...and don't forget to free the x and y data blocks before returning from the ExtendPlot() callback in "dummy.c".

Roberto, you must be tired! 🙂
0 Kudos
Message 3 of 4
(3,221 Views)

Smiley Very Happy

Thanks, Colin: you're right! Smiley Wink



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 4 of 4
(3,206 Views)