11-10-2009 04:12 AM
What are the conditions under which this error (-200474) occurs in the NI-DAQmx driver?
I am looking for something similar to this: http://digital.ni.com/public.nsf/allkb/485201B647950BF886257537006CEB89. Also a more detailed description of this error would be nice.
I encountered this error using a PCI MIO-16E-4 board while reading from an analog input channel. I have a loop that continuously measures values. To obtain a value, I start a task, average a number of 10 000 samples, and then stop that task, and so the loop repeats itself again.
11-11-2009 04:40 AM
Hello Cristian,
This is error tells you there are not enough samples to read within the specified timeout.
How fast are you trying acquire your data? Also, have you tried running any of the shipping examples that ship with the installation of NI-DAQmx?
This would be a good starting point to see if it is something to do with the way your code is set up or whether it is just something to do with the way the DAQmx driver runs. There is a possibility that there is an issue with the way the driver handles your specific case.
First try to run one of the shipped examples. You can find these in the following file path. C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples. Then browse to your version of the development environment and get into the "Analog In\Measure Voltage\" folder and try an example like "ContAcqVoltageSamples_IntClk. If that does not work we may have to look into the driver a bit more.
Regards,
Casper
11-11-2009 06:35 AM
Hi Casper,
The interesting thing is that my application works fine for a number of hours (more than 5-10 h) and then at some point, I get this error.
>How fast are you trying acquire your data?
Once every second I start a task, read 10 000 individual samples, average them, and then stop the task. So I guess it's pretty intensive.
>This is error tells you there are not enough samples to read within the specified timeout.
It can be that during the starting and stoping the task, one of the DAQmxReadAnalogScalarF64 calls returns me this error at some point, because the driver doesn't have time to give me a value anymore. I will try to lower the 1Hz sampling rate a bit, but I will leave the sequential DAQmxReadAnalogScalarF64 calls running at the speed of my app.
A possible solution to my problem would be to configure the driver to average 10 000 samples for me, and then return me a single value. I would appreciate any idea of how to configure the task to do this using the NI-DAQmx API.
Could you also give me some plausible scenarios which could result in an occurrence of this error?
Regards,
Cristian
11-12-2009 04:17 AM
Hello Cristian,
How did you configure the read task, with finite samples/continuous?
If the sample rate is low it may be too slow for the device or the task. Verify that the hardware can support the rate desired. If the timeout is set to default and the rate is slower than 0.1Hz while acquiring more than one sample the rate should be increased. The sample rate should be larger than the samples to read divided by the timeout.
Will it be possible to post your code?
Regards,
Casper
11-13-2009 05:04 AM
The card runs at very high sample rate and works fine for extended periods of time without giving a timeout, except in some singular events:
*DAQmxGetSampClkMaxRate is 500 kS/s
*The DAQmxReadAnalogScalarF64 calls that failed had a timeout of more than 1 second (more than enough to acquire one sample at that sample rate).
Now, what could cause a DAQmxReadAnalogScalarF64 call to take more than 1 second on a PCI MIO-16E-4 with a maximum sample rate of 500kS/s, I wouldn't know. I suspect it's how the driver interacts with the OS (the OS is Windows 2000, and the NI-DAQmx driver is v8.1.0f1).
Are there any known issues with DAQmxReadAnalogScalarF64 in that version of NI-DAQmx?