Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I read > 10X samples at a sample rate of X?

Solved!
Go to solution

When I set up a task to read a finite number of samples, I'd like to be able to read for 120 seconds at my selected rate.  When I try to read for what would take longer than 10s (sample count > 10 * sample rate) I get an error.

 

I realize that I can run this task 12 consecutive times, but this is not preferred due to the overhead time loss in between each call to ReadMultiSample.

 

Thanks.

Programming Data Acquisition and Control in Measurement Studio and Labwindows/CVI
0 Kudos
Message 1 of 6
(4,034 Views)

We need a lot more information in order to help.  What sample rate are you using?  What DAQ card?  What is the error?

 

My guess (purely a guess) is that you are overrunning the DAQ buffer.  My approach would be to use the Stream to TDMS and then post process the data.


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 6
(4,030 Views)

And if you used continuous mode instead of finite samples, you can put the read in a loop with no loss of samples or the overhead you have with finite sample mode. Assuming of course you don't have much else going on in the loop.

0 Kudos
Message 3 of 6
(4,022 Views)
Solution
Accepted by topic author DieselPower

If you are not explicitly setting the timeout input on the DAQmx read VI, it will default to a timeout of 10 seconds.  If you want to do a single finite read, you should probably use your sample rate and your number of samples to compute a reasonable timeout for DAQmx read.

 

Dan

Message 4 of 6
(4,017 Views)

Wow.  Fastest and most brute force response ever.  I'll update the timeout duration and report back with my findings.  Thanks!

Programming Data Acquisition and Control in Measurement Studio and Labwindows/CVI
0 Kudos
Message 5 of 6
(4,001 Views)

This worked.  Thanks!

Programming Data Acquisition and Control in Measurement Studio and Labwindows/CVI
0 Kudos
Message 6 of 6
(3,975 Views)