02-05-2009 01:19 PM
I am rebuilding an application that pulls three large data files (100mb each) off of 3 seperate crio devices and combines the files into one TDMS file. I am getting "memory is full" errors from the TDMS write functions. I did not write this sequence and I am still rather unexperienced with TDMS so troubleshooting this problem has been difficult for me. Other posts I have found on this error have not been helpful because instead of posting CODE people have been saying useless things like "program more efficiently" as if the poster wasn't trying their best to program well. So I am begging for a solution. I don't know how to read the TDMS file in chunks or even how to do what this code does in a different way.
I have posted a screenshot of the code. This sequence of code is run three times, once for each file. Basically what happens is for each time it is run, it opens the data file, filters it. Then it makes a temporary TDMS file and writes the channel names and data to it. Then it immediately reads from the temporary TDMS file and writes it to the final output file. I am not sure I am understanding all the array manipulation going on but I don't see the need to create a temporary TDMS file, write to it and then immediately read from it. I want to just write/append to the final TDMS file each time and be done with it. I really think it is all this reading and writing that is creating multiple copies of the data in buffers and is what is causing the memory full error.
I would really appreciate a solution to this in code if anyone can do it. I just can't figure this out.
02-05-2009 05:34 PM
I don't understand what you would need the temporary file for. Cutting this out might already fix your problem, because you reduce the amount of memory copies LabVIEW will make from your data array. If you want to cut down on memory usage even more, you could for example move "TDMS Write" into the for loop that does the filtering. That way, you would write the channels in sequential order, rather than accumulating them in a bigger array.
Hope that helps,
Herbert
02-06-2009 01:30 PM - edited 02-06-2009 01:34 PM