LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble with DAQmxReadDigital Timeout (200284) when used in a threaded loop

Hi,

I'm using a NI6537 for fast Digital Acquisition. The board is installed on a NIPXIe-1062 crate controlled by a NI PXIe-8130 controller, where the software is running. I'm reading all the 32 lines as a single channel, at 50MS/s, and the clock is the one provided by the board itself. I put the timeout as infinite, but I also tried various other settings. As I'm reading a finite samples bunch of 524288 samples, at 50 MS/s, a timeout of 1 second should be by far sufficient.

 

As far as I put the DAQmxReadDigitalU32(...) call in a simple loop I have no troubles, everything working fine.

 

for (...) {

   DAQmxReadDigitalU32(...);

} // That loop works perfectly

 

 

 

while, if a have a loop inside a multi-thread process, or simply I give the system some freedom inside the loop, sometimes I get the timeout error. Note that the time cost of the Sleep() function is just of some millisecond, so there is no reason for the call to timeout.

 

for (...) {

   DAQmxReadDigitalU32(...);

   Sleep(1); // To release system resources...

}// That loop stops erratically

 

With the last code, I can also see that actually the board did not complete the reading, i.e. is returning less samples than what requested. It seems to me that someting is stopping the acquisition, but I'm not able to figure what. The same happens even in LabView, using the VI read: sometimes the read randomly generates a timeout error and stops, even if LabView is the only running application.

 

Could you point me what I'm doing wrong?

Thanks, Piero.

 

DAQmxReadDigitalU32

0 Kudos
Message 1 of 2
(2,397 Views)
Duplicate Post
ColeR
Field Engineer
0 Kudos
Message 2 of 2
(2,357 Views)