Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I obtain data with sampling rate 44.1KHz?

Hi,

 

I am using cDAQ-9178 , DAQ 9221 with DAQmx in Visual C# 2015.

 

What I want to do is obtaining the data from NI 9221 with sampling rate 44.1KHz.

 

I already used the example code that installed in the DAQmx folder, but the sample code samples the data with 10KHz max.

 

Although the NI 9221's sampling rate is 100KHz, the sampling result doesn't fits with my goal.

 

Then I modified the loop to count the loop speed, without stacking data, I still got the same sampling rate.

 

If I set the sampling rate under 10KHz, it works fine with any range of 'sampling rate' and 'samples per channel'.

 

 

What's the problem and is there any possible method to solve this problem in c# code?

 

//The code below shows the modified code that I mentioned above.

 

private void dataToarray(AnalogWaveform<double>[] sourceArray, ref List<double>sensor1)

{
foreach (AnalogWaveform<double> waveform in sourceArray)
{

textBox1.Text = countloop.ToString();
}
countloop++;
}

0 Kudos
Message 1 of 2
(3,774 Views)

Here's the sample code

0 Kudos
Message 2 of 2
(3,773 Views)