LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory Overflow cDAQ 9174

Solved!
Go to solution

A sample size of of 1 creates a buffer issue, see attached. 

Download All
0 Kudos
Message 11 of 15
(581 Views)

I'm surprised by that because a 10 Hz rate doesn't seem that fast.  That the code should be fast enough to keep up.

 

Go back to Nsamples, and -1 as the number of samples to grab, but look more closely at the error messages, and whether you are getting empty arrays out of the read.

 

I just don't understand how 1 sample at a time can't keep up with a 10Hz rate, but when you do all available samples (with N samples), you wind up with blank data like the code is running a lot faster than the DAQ.

0 Kudos
Message 12 of 15
(580 Views)

I tried moving the timing and start nodes outside the while loop thinking this may have been causing the problem, but it s acting exactly the same.  I dropped a daqmx timing VIs inside the while loop and it spits out a value of 1612.9.  Why would the rate be 1612.9 when I have specified a rate of 100hz?

0 Kudos
Message 13 of 15
(564 Views)
Solution
Accepted by topic author NateJingst

Actually, your VI is specifying 10 Hz, not 100 Hz.

 

But I see what is causing it.  The thermistor DAQ task, is it using the NI-9237 module?

 

Looking at the manual for that module, http://www.ni.com/pdf/manuals/374186e.pdf page 23 shows that the minimum sampling rate is 1613 samples/second.  Pretty much the 1612.9, you are seeing.

 

So if you are sampling only 1 or 10 at a time, you will fill up the buffer and overflow.  If you are sampling all the samples, you'll get a lot and empty the buffer.  I still don't know why you'd be getting zeroes at times.

 

Taking a closer look at the entire array of data when you wire up -1 to the number of samples to read.  Do you see zeroes in that data?  How large is the array?  What you may need to do is collect the large number of samples, then do some filtering on it.  Or do some resampling to get it to the 10 Hz (or 100 Hz) rate you are looking for.

Message 14 of 15
(559 Views)

Thank you for the help.  Changing the samples per channel on the DAQmx read to -1 seemed to have solved the zeros in the data.  I also moved the wait VI out of the case structure and into the while loop. 

 

The channel property node outputting the sample clockrate is still pinned at 1613Hz.  The TDMS file is writing at a rate of 806Hz, and the fromt panel is updating every 28.5Hz.  I will do some searching/reading on the NI website and see if I can get a better grasp on how to control timing.

0 Kudos
Message 15 of 15
(520 Views)