Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Minimum timeout for read operation in PCI-6052E.

Hi,
 
I am running an application at 600Hz where I must read data from a deice using the PCI-6052E. Running at 600Hz, i.e Ts=1/600 second, my read timeout in the DAQmxReadAnalogF64 function must be < Ts. Although, the application starts fine after few reading cycles, the application crashes  with a DAQmx error:
 
"DAQmx Error: Measurements: Specified operation did not complete, because the specified timeout expired.".
 
knowing that the PCI-6052E can operate at 1Khz rate, taht is T=0.001, I find it wired that it is crashing for timeout I am using Tout=0.7*Ts whic is > than T. 
 
What is the minimum timeout required?
 
Thanks.
 
Elias
"A man can succeed at almost anything for which he has unlimited enthusiasm."
0 Kudos
Message 1 of 2
(6,371 Views)

Hi,

Timeout specifies the amount of time in seconds to wait for samples to become available. If the time elapses, the VI returns an error and any samples read before the timeout elapsed. The default timeout is 10 seconds. If you set timeout to -1, the VI waits indefinitely. If you set timeout to 0, the VI tries once to read the requested samples and returns an error if it is unable to.

By available we refer to the data that has been acquire by the card and placed into the buffer. You are doing a on sample at a time and that you are not using the onboard clock. Since you are not using the onboard clock you don’t have determinism on the rate at which you acquire the samples. “I think by default the 6052E clock is 1KHz”, incorrect if you select your timing as on “sample on demand” the rate is controlled by your “timed loop” but since you are not in a Real Time OS you don’t control the rate of the loop, at least at very high rates, you may run the first couple of iteration at one speed, then something happens on your PC and you CPU load increases, changing the rate of the while loop.

You have two options to set the rate you can do a software timed operation (i.e. like you are doing right now), but it will be depended on your OS and your CPU load or you can do a hardware acquisition where an onboard clock controls the rate of the acquisition.

“I do not expect this to happen especially that the PCI-6052E device used in doing the reading operation can run up to 1 KHz. I am not sure what the problem is.” The problem here is that is not the 6025e not been able to keep up is your computer. Look at the examples in: C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Analog In\Measure Voltage\ and let me know if they help.

You can post your code and I will lok at it if you want

I hope it helps

Jaime Hoffiz
National Instruments
Product Expert
0 Kudos
Message 2 of 2
(6,354 Views)