Ed,
Hi again on a different thread. I think there are ways to handle your situation, but I don't know the exact syntax for DAQmx dll calls -- I'm a LabVIEW guy. Let me offer up a few thoughts from the LV world.
1. DAQmxSetReadOverWrite - I used a similarly named DAQmx Read Property under LV hoping to let the acquisition buffer keep overwriting itself circularly if I didn't read data out of it for a while. It didn't work for me either, though the failure was only an error code and no data returned not a system crash. I found a workaround for my app and I hope a variation on it can work for you.
2. By default the 'Read' operations want to read the earliest unread data. This is because of DAQmx properties with names like 'RelativeTo' and 'Offset' that have default values of 'earliest unread data' and 0 respectively. You could set them to 'Most Recent Sample' and -100 if you wanted, then when you perform a 100 sample read you'll get just the 100 most recent points. This was all I needed for my app and it worked fine. I could let the buffer overwrite dozens of times between reads, and as long as I set up the read position properties I would get data back without errors.
3. There are additional properties to query such as 'Current Read Position' and 'Total # Samples Acquired". I don't recall the details, but these seemed to behave a little odd I thought. Like, I think 'Current Read Position' would reset to 0 and stay there after the first buffer overwrite. I *think* 'Total # Samples' kept a correct running total though I'm not sure how much that'll help your specific problem.
4. During testing, I expect you need to acquire a continuous stream of data with no interruptions or overlaps, right? Can you do it by simply making your buffer big enough to hold all the test data and then reading it all out using the method in step #2 at the end of the test? If not, there still *should* be a way to accomplish what you need, though I'm not 100% certain that it'll work. Here's the idea I picture:
a. Read, say, 1000 samples setting up RelativeTo='Most Recent Sample', Offset=-1000.
b. Query DAQmx for the 'Current Read Position'. This could be a problem because the way I remember it, this value quit updating after the first buffer overwrite. But maybe that's just in LV, or maybe there's another property to query that'll give you the right info.
c. Now read, say, 1000 samples setting up RelativeTo='First Sample', Offset = Current Read Position (maybe +/- 1).
d. Loop over steps b and c until you've collected your test data. Then you can rever to occasional queries for recent data, not caring if the buffer overwrites in the meantime.
-Kevin P.
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.