04-22-2009 01:42 PM
I'm trying to use the WaveformGraph to review recorded datasets, and currently am seeing terrible performance with files > 10mb or so (I'm seeing over 10-fold memory usage!). I'm a bit confused as to why the graph seems to be holding onto so much memory even after I call ClearData().
What I'd like to do is decimate my data initially and plot it, and as the user zooms or pans reload the appropriate section with more resolution. I know I can use the (On)Zoom events, but not sure what the best way to go about reloading the data is. Should I try and update each plot in the collection, or is it easier to just start over and plot the newly decimated set? This solution seems like it would not work smoothly, and I'm not exactly sure how to handle pans.
Any ideas or help from someone who's done something like this before would be much appreciated.
04-23-2009 05:34 PM
Tyler,
A couple of questions. First of all what version of Measurement Studio are you using. In recent versions of the software the WaveformGraph updating and performance issues have been improved dramatically. In addition, before you try decimiating the data you may try looking at the included documentation of Measurement Studio for the help file titles "Optimizing the Measurement Studio Graph...".
If you want an example of decimiating the data please take a look at Abhishek Ghuwalewala code in this forum post, Display analog waveform with millions of samples (http://forums.ni.com/ni/board/message?board.id=232&message.id=4235&requireLogin=False)
Regards,
Steven Zittrower
Applications Engineer
National Instruments
04-24-2009 12:39 PM
Hi Steven, thanks for the reply. We are using the most recent version of Measurement Studio that came with our subscription, 8.6. The WaveformGraph seems to do okay for real-time use, but for displaying large static datasets it is trying to do too much - besides the memory use, it attempts to process the whole file for autoscaling, which takes a long time. Setting the y-axis to fixed helps alleviate this problem.
The code in that post looks helpful, it seems they are using the OnBeforeDraw event of the WaveformPlot to initiate the decimation. Could you tell me if there is any more documentation on the WaveformGraph than what is installed into Visual Studio's help? It would be helpful to see how the WaveformGraph/WaveformPlot events are triggered in order to determine which other ones might be good to tap into.
Thanks again,
Tyler
04-27-2009 11:55 AM
Tyler,
Unforuntately, what is in the help and the shipping documentaiton is really the only source for further information on these methods and functions. If you have specific questions on how these functions work or how to use them I may be able to answer them though.
Regards,
Steven Zittrower
Applications Engineer
National Instruments