12-01-2025 01:24 PM
I'm continually getting error 200279, and none of the existing topics offer much for solutions.
From the error description, the issue is a likely a buffer overflow. Experimenting with some of the variables I think should be contributing, the "rate" of the daqmx timing seems to be the biggest contributor and changing that impacts how quickly I get the error so I've made that as small as I can. I also had a "wait until next millisecond multiple" in the while loop that seemed to have a small impact so I removed that in case that was the issue. I thought the "number of samples" would factor in, and the help menu states it controls the buffer size in continuous mode, but I found changing that had no impact at all.
The slowest sample rate I can use without missing datapoints is ~60Hz and I'm still getting error 200279 after ~100 minutes. That sample rate seems like it should be slow enough that my while loop should be able to execute fast enough to keep up even if it is rather inefficient. I need this program to be able to run for a few days at a time without giving an error so I want to understand what part is not able to keep up.
What am I missing that would cause the buffer to fill up and create this error? Does the number of input channels have an impact on this (I'm using 8 with this setup)?
12-01-2025 01:57 PM
Without seeing any code, not much we can advise. There should be no timing functions in the read loop.
12-01-2025 02:32 PM
"There should be no timing functions in the read loop." Yes, I already removed it when troubleshooting earlier.
1. Open one of the Continuous Acquisition Examples in the example finder. Run that and see if you get an error.
Might be the issue, I don't think I had this part.
2. How often are you reading the data? Every 100ms works well for most situations.
How do I specify this? Is it not the same as the sample rate? Is it what's pictured above?
3. Are you doing anything else in the read loop that can slow it down?
I don't think so.
4. Attach your code and save it for a previous version like 2020.
Ah shoot, I tried to attach the code but the page refreshed when I tried to post and removed it. Is attached now.
12-01-2025 02:50 PM
Hi rdobro,
on topic 2: setting the sample rate does not define the loop iteration rate!
Example: you set 60S/s sample rate and read 6 samples per Dawn read so the loop will iterate at 10Hz. Simple math: iteration rate=sample rate/number of samples...
Let DAQmx do the timing!
12-01-2025 02:57 PM
I modified one of your reads to do multiple samples, then take the average so the rest of the array operations do not need to be modified.
You will need to decide if you need all the points; if so look into a producer consumer type architecture.
Look in the example finder for a good start.
12-01-2025 03:07 PM
"setting the sample rate does not define the loop iteration rate!"
Well yes, I've figured out that much. What I want to learn is what does define loop iteration rate. Is the following what defines it?
My initial assumption was that the loop would iterate as fast as it could, and unless there was a delay in the loop or something intensive that would bog it down, that would be faster than 60Hz. I get why iterating too slowly like your example would be a problem, but is it also a problem if the loop iterates faster than the sample rate?
12-01-2025 03:45 PM
1.You are reading a single sample at time; there is no way you can keep up.
So in what case would one actually use 1 Sample reading? Shouldn't it be able to keep up if the loop runs faster than the sample rate?
3. You want to specify Reading multiple samples at a time, around 100ms worth of samples.
I modified one of your reads to do multiple samples, then take the average so the rest of the array operations do not need to be modified.
So when changing it to "N samples" is that just changing every datapoint to an array and that's what breaks the subsequent steps?
With how I currently have it as "1 sample" is that just missing many of the samples?
You will need to decide if you need all the points; if so look into a producer consumer type architecture.
The way I have it now is orders of magnitude more datapoints than I need so that is absolutely what I want to do. I tried to ask how to set that up initially but the answer I got was to downsample the data after the loop.
I need to run the program at at least 60Hz to get the cycle count portion to not miss datapoints. I was having trouble figuring out how to run that part fast enough, but have everything else much slower.
Sorry for being so inexperienced, but what would I even have to search to find a producer/consumer example in the finder?
12-01-2025 06:22 PM
So in what case would one actually use 1 Sample reading? Shouldn't it be able to keep up if the loop runs faster than the sample rate?
So when changing it to "N samples" is that just changing every datapoint to an array and that's what breaks the subsequent steps? With how I currently have it as "1 sample" is that just missing many of the samples?
Sorry for being so inexperienced, but what would I even have to search to find a producer/consumer example in the finder?