Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 69089

DAQ read freezing

$
0
0

Hello,

I've been using a producer/consumer loop for the past three years without issues. This month, I increased my sampling rate from 100 Hz to 1500 Hz and encountered a problem with my VI. My DAQmx task is set to continuous nChan nSample.

 

I run biofeedback experiments, meaning participants see real-time data on a monitor. The issue arises when I read 30 samples at a time from the DAQ buffer (equivalent to a 50 Hz display rate). I experience random freezes lasting over 2 seconds. However, I don’t lose data since the DAQ continues recording into the buffer, which I’ve sized at 15,000 samples. But a 2-second freeze is far from ideal for biofeedback.

After extensive testing, I found that the DAQmx Read VI is responsible for the freeze—it’s not caused by other parts of my code. When I isolated the issue, everything pointed to the DAQmx Read VI itself.

 

Interestingly, when I set the read parameter to "Read all available data" (-1) or use the AvailSampPerChan property, everything runs smoothly. The only drawback is that my producer loop starts running at 3000 Hz, likely because when there’s nothing to read, the iteration continues instead of waiting. While this works, it doesn’t seem like the most efficient solution.

 

I was previously advised against using AvailSampPerChan, though I don’t recall why.

While I’m glad that the -1 input resolves the issue, I don’t understand why specifying a fixed sample size causes these freezes. It feels as if my DAQ’s internal clock is malfunctioning.

 

Any suggestions on what could be causing these freezes?

Thanks!


Viewing all articles
Browse latest Browse all 69089

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>