LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory full Error in the code

Hii,

I am have written code for data acquisition at 1M sampling rate which is writing tdms file of 1 minute. The file is being written every minute but somehow the code is not running properly, it stops automatically sometimes, and at times it gives memory full error. Earlier it was working perfectly. i have not made any changes since then. I have a backup code also, and both codes have no difference. One is working perfectly fine and other one is creating problem. Kindly help me with this.

Download All
0 Kudos
Message 1 of 11
(2,978 Views)

@shivam_2 wrote:

I am have written code for data acquisition at 1M sampling rate which is writing tdms file of 1 minute.


Writing to a TDMS file?  Use the DAQmx Configure Logging to have DAQmx stream the data to a TDMS file.  This will eliminate the need for the Producer/Consumer and will run a lot more efficiently.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 11
(2,922 Views)

You should keep your topic in one post. Why did you create a new one?

Duplicate post, original discussion is here:

http://forums.ni.com/t5/LabVIEW/How-can-I-Acquire-data-and-make-tdms-file-for-a-variable-period/m-p/...

 

0 Kudos
Message 3 of 11
(2,915 Views)

hello sir,

 

will it work for 1M sampling rate also? Because we used that earlier it was logging just 12 seconds of data in one minute.

0 Kudos
Message 4 of 11
(2,879 Views)

shivam_2 wrote:  will it work for 1M sampling rate also? Because we used that earlier it was logging just 12 seconds of data in one minute.

I have had it work with a 1MS/s.  You might have had something wrong with your setup.  Post some code and we can have a look.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 11
(2,874 Views)

hello sir,

 

i have attached the code. Its showing me error currently.

0 Kudos
Message 6 of 11
(2,853 Views)

1. You need to use the DAQmx Configure Logging before starting the task.

2. You likely are having the problem of overrunning the buffer.  Read a bunch of samples in a loop to keep the buffer clean.

3. You can greatly simplify the building of the log file name with a Format Into String.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 11
(2,845 Views)

Thank you so much sir, i will definitely apply these things.

Also, I haven't used the string to name the logged file, bacause ultimately I want to save files for a variable time say 15 secdonds or one minute. data has to be acquired constantly for 8 hours but different files have to be created according to the time span which we want.

 

Regards

Shivam

0 Kudos
Message 8 of 11
(2,822 Views)

hello sir,

I tried that code , its loggong the data perfectly but i have encountered error -200279. Plus waveform graph is not shoing me any data.

Also, how should i provide time stamping to my channels.?

Download All
0 Kudos
Message 9 of 11
(2,817 Views)

@shivam_2 wrote:

I tried that code , its loggong the data perfectly but i have encountered error -200279.

Try reading 1000 samples per iteration.  You might be trying to read too may samples than the buffer can hold.

 

Plus waveform graph is not shoing me any data.

I would change them to a Chart.  I would also not use the Split Signals.  Just use 1 chart and let all the signals be displayed in it.

 

Also, how should i provide time stamping to my channels.?

DAQmx is doing that for you in the charts and graphs.  In the TDMS file, just the start time and sample rate is stored.  You can easily calculate the timestamps and add a channel to your task afterwards.


 


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 10 of 11
(2,802 Views)