LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory usage problem with TDMS files

Hi,

I have used TDMS write file to save my real time data .  I need to leave my VI,  running   for a long time (even one day ) then I  process the acquired data in a seperate vi.

My problems are

I olways get memory usage message during data  acquization. Also even if I finish acquization ( for example make a 2GBytes TDMS file I get the same message when I want to try to read it. 

To read the TDMS fisrt I open ,configure ,read and then close the TDMS ref.Then I use the data from the TDMS as input to my loop.

By using this method I olways get (Memory usage message ) and I need to stop the process loop. Would you please help me how can I avoid this problem

 

0 Kudos
Message 1 of 7
(3,039 Views)

Obviously you will get Memory error (Be happy your LV didn't crash while reading the file). The reason is you may write the data to a same file continously at specified interval while doing that you have to be sure that you are not holding large data in code, if you do so you will get memory error while writing. Then while reading the file LV tries to keep the data in the dynamic memory and since your memory is not that big you wil get that memory error while reading.

 

Simple solution:

 

Try to write the data into different files for say every 1 hour so for 24 hours you will have 24 file. This you can still extend depending on the rate and number of samples /sec you need to log.

 

good luck.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 7
(3,029 Views)

Many thanks for your answer but can you show me with a simple example how can I write my data in seperate TDMS files and how can I read from them and attach all data together

0 Kudos
Message 3 of 7
(3,010 Views)

Better to say  how can I  log data into multiple files . I have 2 parralel loops in my VI . one loop dis for data acquization and the other one process the data using queue structure. Then I need to save the processed data in TDMS format.

To log into multiple files I tried to use a timer inside my process loop so when the specified time( 1 hour ) has elapsed then I trigger an event to change the TDMS address outside the loop but it is not working . Would you please show me with a very basic example how I can change the address of the TDMS file using events or case structure or any other methods.

Many thanks

 

0 Kudos
Message 4 of 7
(3,003 Views)

your problem is the attempt to attach all the data in one big goo in memory. A 2GB TDMS file needs probably a little more than 2GB in memory if you want to read all its contents at once. That is BAAAD! You should try to write your analysis in a way that can read the data in smaller chunks and process each chunk individually instead of trying to load the entire GIGA blob at once. Computers can have a lot of memory nowadays but that does not mean that you should attempt to operate on GigaByte data in memory in one go.

Rolf Kalbermatter
My Blog
Message 5 of 7
(2,999 Views)

Thanks

 

0 Kudos
Message 6 of 7
(2,995 Views)

What error do you get? If you want to change the file address you must use TDMS Close to close the tdms file first.

0 Kudos
Message 7 of 7
(2,963 Views)