Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Why RAM memory grows during data acquisition and saving data to Binary Files?

Hello, I am saving data during my acquisition (Analog Inputs) to binary file, but my RAM memory is filling too fast, do you know, where should by problem? I append my program. Thank you for your answer.
0 Kudos
Message 1 of 4
(3,018 Views)

Hi Moni,

This is expected behavior with the TDM storage file.  All of the data is stored in RAM until the file is closed (see Can I Use the Storage VIs in LabVIEW 7.1 to Stream to Disk? for details).

To get around this you can either write to a binary file (not TDM), or use a TDMS file which was introduced in LabVIEW 8.2.  The above document discusses using a TDM Header Writer  to have TDM functionality when writing to a basic binary file if you do not have LabVIEW 8.2.

Hope this helps,

Jennifer O.
Applications Engineer
National Instruments

0 Kudos
Message 2 of 4
(3,005 Views)
Hello,  I understand my data are saving to the RAM until I close File, ok. I have one question...can I  organize that I save data during my acquisiton  directly to the disk? I dont knowh how it works but I represent it like I acquire data from analog input to the RAM, they write down to the file in the disk and then I can again acquire another data? It should be impossible, but I need acquire data the whole day in my experiment and I seem problem with filling RAM memory. Thank you for your answer Monika
0 Kudos
Message 3 of 4
(2,975 Views)

Hi Monika,

Yes it is possible to acquire data without filling your RAM by using a simple binary file instead of TDM.  This way you read a smaller amount of data, write it to file, and then acquire more data. 

See your LabVIEW examples (Help>>Find Examples) for 'Write Binary File.vi'.  This example shows a single write to a binary file.  The data is simulated. This example can be easily adapted to your application by replacing the simulated data with your data read function(s) and placing a while loop around the acquisition and file write portion of the code to make the operation repeat. Leave the open and close functions outside of the while loop so that the execution is as follows:

1. Open file& set up acquisition task
2. Acquire data & write to file (repeat until stop condition is true)
3. Close file and stop/clear acquisition task

Regards,

Jennifer O.

Message 4 of 4
(2,950 Views)