Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

When plotting XY data from a thread other than the UI thread, previously plotted data is lost or corrupted whenever new plot data causes the plot scale to change.

Seems OK if autoscale is disabled or when plotting from the UI thread. A small example project which illustrates this behavior is attached.
0 Kudos
Message 1 of 2
(2,963 Views)
The graph that you are using has had its "Copy Original Plot Data" setting turned off. When you do that, the graph maintains only a pointer to the array data that you passed to the plotting function, not the data itself. This is a memory saving option.
When that setting is turned off, the assumption is that the data is still available at the original pointer location, whenever the graph needs it. However, in this case you are reusing the same array to hold the second plot's data. Consequently, the plot will "disappear" when the scales change, because that's when the graph needs to go back to the original data in order to remap it.
You can fix this by either turning that setting back on in the UI Editor (or programmatically, using SetCtrlAttribute), or alte
rnatively you can use a different array to hold the second plot's data.

Luis Gomes
NI
Message 2 of 2
(2,963 Views)