02-12-2021 04:04 PM
Is it possible to free up/release the memory from the data displayed on a waveform chart?
LV2018, I'm making a DAQ system using the Continuous Measurement project template as my starting point. The chart is set up for strip chart and I have been playing around with the chart history length to find a "sweet spot" between how much data the user can scroll through on the chart and how much memory is used while the program is running. I'd like to know if it possible to free up the memory when I stop the acquisition?
What I'm ultimately trying to do is (this will probably sound dumb) but when the user hits the start button, the system samples several channels at a decently high sample rate, displays about 60 seconds of data on the chart (this equates to about 900MB of memory usage with my chart history length increased). During this time, I made a ring buffer of 5 TDMS files that data is written to which stores about 2 minutes of data. Once the stop button is hit, I'd like to be able to open the TDMS files(s) in a waveform graph to take advantage of the cursors and make some basic measurements and at the same time delete the data from the waveform chart to free up the memory for the graph.
I realize this in essence is doubling up the memory usage because I get the not enough memory error when I try to open the file. I had hoped simply writing an empty array to the chart would free the memory but ofcourse that would be to easy.
Any suggestions?
Solved! Go to Solution.
02-13-2021 02:34 AM
Hi Wayne_CSE,
Can you share your program? it makes it easy to help 🙂
Maybe, you can save measurement to TDMS file, every measure data, save it to TDMS file.
For example, every 1 second, save you array data to TDMS, then remove the array data.
02-13-2021 02:15 PM
The data is saved to a TDMS file and every 30 seconds a new file is opened. I see what you're saying about the array but then I won't have a way to visualize the data on the chart real time.
02-13-2021 03:13 PM
To speed up your data display and reduce your memory requirements, you need to decimate the data.
Look at this example here https://forums.ni.com/t5/LabVIEW/Re-Rube-Goldberg-Code/m-p/3771315/highlight/true?profile.language=e...
Basically store your data in one buffer, decimate it to display. If the user zooms in on the plot, re-decimate the data based on the new endpoints. At some point in a zoom, you don't need to decimate the data, just display it.
mcduff
02-14-2021 01:19 PM
I guess I need to do some reading on decimation. Thanks for the help.