Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Sample Rate & Timing

I'm using a DAQmx task to continuously acquire analogue data.

 

I have used Task.Timing.ConfigureSampleClock to specify a 'rate' of 1000 and a 'samplesPerChannel' of 1000. So, I expect to receive 1000 points of data every second and this is exactly what I seem to get in my AsyncCallback.

 

However, I want to also generate an array containing the elapsed time since start of capture. My plan was to start at zero and then increment values in my time array by Waveform.Timing.SampleInterval however I find that Waveform.Timing.SampleInterval is 0.00062 seconds - why is it not 0.001 seconds?

 

I then double-checked the task sample rate by using Task.Timing.SampleClockRate and this seems to be 1612.9... - why is it not the 1000 I set during my call to ConfigureSampleClock?

 

Any pointers would be appreciated.

 

TIA

 

 

 

0 Kudos
Message 1 of 3
(4,704 Views)
What is your hardware? Have you looked at the manual/specs to see what are the actual sampling rates supported by the device?
0 Kudos
Message 2 of 3
(4,698 Views)

Thanks, you're right - I was specifying a sample rate lower than was available for the module I was using (the NI9239). I actually was expecting an exception to be thrown if I attempted that.

 

So, to make sure I don't get into this situation again I can make sure I select from the supported sample rates of 50/1→31 kS/s for this particular module.

 

Would you know if there is a programmatic way of finding the available sample rates for all module types? Perhaps I can assume it will always be Maximum Sample Rate/1→31?

 

TIA

0 Kudos
Message 3 of 3
(4,681 Views)