Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get data at >1MHz using DAQMx driver in C#?

Solved!
Go to solution

Hi,

 

I am using DAQ 6210 with DAQMx in Visual C# 2010.

 

Although the DAQ can provide data rate of >50MHz but right now I need to program for data rate of 1MHz initially. 

 

I created a task with 10000 as clock rate, with "/Dev/PFI0" as external clock. Also I increased the buffer size  to 100000.

 

Then I used the .net timer control with interval set to 1ms and at each tick I read 1000 samples using reader.ReadMultiSample command.

 

Correct me if I'm wrong; I think it would sample 1000 samples every 1ms.

 

This should give us 1000*1000=1MHz frequency and 100000 samples.

 

But thats not what happens, I start the acquisition for one second and I only get ~10000 samples. 

 

I found that the timer only ticks 10 times in 1 second! 

 

I doubled checked the timer interval value, it was set 1 throughout the program.

 

What am I doing wrong here? I wonder if this is some limitation for the timer control? If that is the case how can I sample at very high sample rates using DAQMx libraries only.

 

Can you kindly help me out here?

 

Thanks.

0 Kudos
Message 1 of 2
(2,857 Views)
Solution
Accepted by topic author Xichan
You don't understand basic arithmetic and DAQ hardware If you have a sample rate of 10000 samples per second and request 1000 samples, the acquisition will take .1 second. The software counter is irrelevant. You also seem to be confused about sample rate and number of samples. If you really need a 'rate' of 1 MHz, that is the sample rate you have to program. If you really want 1 million samples, at a 10 kHz rate, it will take 10 seconds to acquire that many samples.
0 Kudos
Message 2 of 2
(2,853 Views)