Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

AI sample rate is being divided by number of channels + 1 for simulated ENET-9213, WLS-9213, and USB-9213

Solved!
Go to solution

Hi,

 

In the attached sample code, I create a task with only one AI channel.

I get the maximum sample rate using DAQmxGetDevAIMaxSingleChanRate (or DAQmxGetDevAIMaxMultiChanRate), both return the same value of 1351 S/s.

 

When I try to configure the sample clock timing using DAQmxCfgSampClkTiming to the maximum sample rate  it does not accept the rate and returns the following error. Notice that the error message indicates 2 channels eventhough only ONE channel was added.

        // OUTPUT:
        // ***DAQmx Error:
        //Sample rate exceeds the maximum sample rate for the number of channels specified.
        //Reduce the sample rate or the number of channels. Increasing the convert rate or
        // reducing the sample delay might also alleviate the problem, if you set either of them.
        // Number of Channels: 2
        // Sample Rate:  1.351351e3
        // Maximum Sample Rate:  675.675676

 

Why does the device driver think I have 2 channels in the task when only one channel was added?

 

Please find the code to reproduce this problem attached.

 

Regards,

   whemdan

   The MathWorks

Download All
0 Kudos
Message 1 of 7
(3,788 Views)

Hi,

 

Please look at the 2nd attachment.

I just noticed that I accidentaly added 2 attachments.

 

Thanks,

   - Wael

0 Kudos
Message 2 of 7
(3,759 Views)

Hello whemdan,

 

On a previous post you mentioned that you weren't able to get a valid result using the max sample rate property.  Were you able to get things working since then?  I will take a look at the code to see if I can reproduce the problem, but I think it's best if we just work from this one forum post from now on.

 

Regards,

0 Kudos
Message 3 of 7
(3,749 Views)

Hi Brandon,

 

Thank you for your help.

So just to clarify, on the other post, I describe a case where the maximum sample rate being returned was not what was expected. This problem still exists, but it seems that if I configure the channel, by setting a sample rate to it, I can move forward a little bit, but then I run into another problem where it thinks that I have 2 channels instead of one.

 

Thanks,

   - Wael

0 Kudos
Message 4 of 7
(3,734 Views)

Hello Wael,

 

I was able to reproduce this same error in C as well as LabVIEW using a simulated 9213.  Are you still using a simulated device in your setup as well?  I am checking to see if there isn't a CAR (Corrective Action Request) filed on this issue and I am also going to try it using an actual 9213 instead of simulated.

 

Regards,

0 Kudos
Message 5 of 7
(3,704 Views)

Hi Brandon,

 

Yes, I am still using a simulated device in my setup.

 

Thanks,

   - Wael

0 Kudos
Message 6 of 7
(3,698 Views)
Solution
Accepted by topic author whemdan

Hi Wael,

 

By default, the ENET/WLS/USB-9213 in NI-DAQmx has the AI.AutoZeroMode property set to DAQmx_Val_EverySample. This causes NI-DAQmx to acquire the device's internal autozero channel (_aignd_vs_aignd) on every sample in order to return more accurate measurements, even if the device's operating temperature drifts over time. If you need higher sample rates than this allows, you can call DAQmxSetAIAutoZeroMode(..., DAQmx_Val_Once) (which acquires the autozero channel when you start the task) or DAQmxSetAIAutoZeroMode(..., DAQmx_Val_None) (which disables autozero entirely).

 

Note that for thermocouple measurements using the NI 9213's built-in cold junction compensation sensor, NI-DAQmx acquires the built-in CJC channel (_cjtemp) on every sample as well, for the same reason.

 

Brad

---
Brad Keryan
NI R&D
0 Kudos
Message 7 of 7
(3,686 Views)