I found a system to try it out and got the same behavior you're describing. The 'available points' attribute doesn't seem to get reset when data is read. My test was with NI-DAQ 7.2 -- what version are you using? (BTW, the same behavior resulted from both LV 6.1 and 7.0).
I suspect this is a bug in NI-DAQ because I've made numerous apps in the past where it behaved properly. I am not certain which version of NI-DAQ I can vouch for, but it was probably ~6.9.x
Now for the good news -- there's a workaround! This goes back to the method used before the "Get Attribute" routine existed, and is analogous to the method one can use with analog acquisition.
Replace the
query for 'available points' with a call to 'Read Buffer', but tell it to read 0 points. Then the 'backlog' output will tell you the # of available points, and you can pass that # into the second "real" call to 'Read Buffer'.
I didn't try converting, but I suspect that it would also work properly if you used the DAQmx interface to the hardware.
Attached is a library with 2 top-level vi's. The only difference is that one calls 'Get Attribute' asking for 'available points' while the other calls 'Read Buffer' with '# to read' == 0.
Does anyone out there have a system with an older NI-DAQ to test these out? I'll wait a couple days for responses before filing a (suspected) bug report.
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.