LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory problem in this vi , how can I save memory( very urgent)

Hi,

This attached vi is used as an subvi in my progra, . It basically read 10 digital signals from a TDMS file ( every signal contains 17 million samples ) . Then I use getwaveform subset to be able to graph from a start point for a certain duration and then I would like to split the signals to graph only the first 4 samples and then plot them on the graph. The main problem I have here is memory. These digital waveform are very big and these functions take a lot of memory

 

also as I said I use this as a subvi and this vi is always running and I supposed to update the graph whenever the user set a new start and duration. The problem I have seen is whenever I run this vi I should pull up the whole digital data from thye TDMS files and then consumpted memort adds up until I get run out of memory message. Specially the split functions takes a lot of memory

Could you please let me know how can I make this program memory efficient. ? Is there any way to read the digital data just one time ?  Is there anywat to free memory after plotting on the graph?

 

Here are also some statistics about the memory usage

 

read TDMS 2.5 GBytes

Subset   3.2 GByte

Split   3.8 GByte

and then run out of memory

 

Thanks

0 Kudos
Message 1 of 8
(2,939 Views)
Do you have to read out all the data? You can use the TDMS functions to read only selected portions. This way you only need to load what you are interested in into memory.
Craig H. | CLA CTA CLED | Applications Engineer | NI Employee 2012-2023
0 Kudos
Message 2 of 8
(2,920 Views)
Yes I need to read the whole data if the user wants to see the entire signal
What I would like to do is free memory after plotting the graphs or do something so memory don't accumulate

Could you please let me know how can I relate start time and duration to read selected
portion of Tdms file?

Thanks
0 Kudos
Message 3 of 8
(2,913 Views)
How can I flush the memory after every read and graphing? I use tdms close to close the reference but seems like the data is still there even after closing the vi, just when I completely close labview the memory will release
0 Kudos
Message 4 of 8
(2,908 Views)

any help really appreciated, how can I split and load part of the data in the TDMS file and also flush memory after reading the data from TDMS.

Or is there any way to save memory in countiously running memory in the the attached vi

thanks

0 Kudos
Message 5 of 8
(2,872 Views)

TDMS Read reads partial data through "offset" and "count". Thus, you can relate duration with count by starttiem(t0) and interval(dt). For the memory flush issue, LabVIEW manages the memory reclaim by itself. There is no explicit way for users to free memory in LabVIEW as far as I know. Once you no longer use the array of data any more (no reference to the data wire), LabVIEW will free the memory.

0 Kudos
Message 6 of 8
(2,831 Views)

What you should do is already mentioned, use Offset and then read your 4 samples(!)

If you want an overview of the full sample before selecting which part, you can loop through your file, read 1million samples/loop and downsample 1:10 before plotting.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 8
(2,812 Views)

Next step would ofcourse be to catch a zoom-event on the graph, and read e.g. 10000 samples without downsampling for a accurate zoomed in graph.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 8
(2,808 Views)