09-16-2009 04:17 PM
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
Solved! Go to Solution.
09-17-2009 02:07 PM
Hi,
Please look at the 2nd attachment.
I just noticed that I accidentaly added 2 attachments.
Thanks,
- Wael
09-17-2009 07:11 PM
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,
09-18-2009 10:36 AM
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
09-21-2009 10:12 AM
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,
09-21-2009 12:33 PM
Hi Brandon,
Yes, I am still using a simulated device in my setup.
Thanks,
- Wael
09-21-2009 06:54 PM
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