Quantcast
Viewing all articles
Browse latest Browse all 203384

Re: Decimate.vi doesn't work for me

That is a buffer overrun error.  You don't have your acquisition rates and number of samples to read set correctly.

 

All 3 DAQ assistants are set for continuous samples.  So once they start executing the buffer starts filling up.  Your two 9237's are set for 50k samples at a 2k rate.  So it will take 25 seconds for it to return data.  (As a separate issue, you set your timeout to 25 seconds, but that is probably too close to how long it takes to acquire data.  It is always on the verge of timing out when it finally gets its last sample.  Any minisicule delay could result in a timeout error.)

 

Your 9219 is set for 2k samples at 100 Hz, so it takes only 20 seconds to acquire your data.  (Again, the timeout is too close to that.)

 

So what happens?  Your 9237's establish the loop rate at 25 seconds.  In 20 seconds, the 9219 returns 20 seconds worth of data, but collects 5 more seconds.  Next iteration.  After 15 seconds, the 9219 returns 20 seconds worth of data (5 from before, and 15 new)  then proceeds to collect 10 more seconds in the buffer before the 9237's return their data and the loop iterates.  Third iteration, 9219, 20 seconds worth of data (10 from the buffer, 10 new), then 15 more seconds fill up the buffer.  After every iteration, the buffer fills up with 5 more seconds.  Do it long enough and the buffer will overflow and you'll get that error.

 

Balance your data collection rates better.  For the 9219, collect 2500 samples at 100 Hz, so you get 25 seconds worth of data.  Or return all samples instead of a finite amount.  You'd be better off using the underlying DAQmx functions than using the DAQ assistants.  Do you really want every loop iteration to take 20 or 25 seconds?  That is a long time that the VI will look like it is doing nothing.  If you hit the stop button, it will take up to almost 50 seconds for the VI to actually stop.  Collect fewer samples per iteration.

 

Why are you collecting so many samples at a high rate?  You are decimating them without doing any averaging, so you are just throwing away most of the data.  You might as well collect feweer samples at a lower rate.


Viewing all articles
Browse latest Browse all 203384

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>