Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

USB-6215 DI ReadMultisamplePortByte rate is only 2kHz

Solved!
Go to solution

I'm attempting to use the USB-6215 to determine the speed/direction of a fan using two optical sensors. I'm using the following code in a .NET library to take get 1000 samples from two lines and use the data from when the optical sensors are activated to determine speed/direction.

 

using (Task ctr0 = new Task())
{
  using (ctr0.DIChannels.CreateChannel("usb6215/port0/line1:2", "", ChannelLineGrouping.OneChannelForAllLines))
  {
    ctr0.Stream.Timeout = 500;                    
    DigitalSingleChannelReader dReader = new DigitalSingleChannelReader(ctr0.Stream);

    try
    {
      // Start the task 
      ctr0.Start();
      byte[] results = dReader.ReadMultiSamplePortByte(1000);
      ctr0.Stop();
    }
    catch (DaqException e)
    {
      Console.WriteLine("DAQ Exception: " + e.Message);
    }
  }
}

// Analyze sample data and calculate speed/direction
//...

 

This seems to work fine, except for one thing: the samples only appear to be taken at a rate of 2 kHz. This means that at some higher RPM's, the DAQ will sometimes miss one of the optical sensors being activated. According to the datasheet, the USB-6215 has a max sample rate of 250 kS/s, and looking through some other threads, this rate is divided by the number of channels you are sampling (ie, sampling two channels gives you a rate of 125 kS/s for each channel). My question is, why is my sample rate so low, and how can I sample at a faster rate?

0 Kudos
Message 1 of 3
(3,896 Views)
Solution
Accepted by topic author aswanson08
The data sheet says that the rate you quote is for the analog input. It clearly states that the digital I/O is software timed and you are lucky to see 2kHz. The max with software timing is usually around 1kHz.
Message 2 of 3
(3,890 Views)

Dennis,

 

Thanks for your reply! I do see now that I was looking at the sample rate listed for Analog Input. I must have missed the mention of DI/DO being software timed in the User Manual. It unfortunately doesn't seem to be listed in the data sheet. I may look into converting my measurement to an analog input to get the speed I need...

0 Kudos
Message 3 of 3
(3,879 Views)