09-15-2016 10:32 AM
When doing a continuous buffered acquisition (hardware-timed), DAQmxReadAnalogF64 and DAQmxReadAnalogScalarF64 read (and remove) data from the NI-DAQmx acquisition buffer.
From the same task, I would like to read one sample on demand while a buffered hardware-timed acquisition is taking place at the same time.
Is there a NI-DAQmx function that can return the latest acquired sample and does not interfere (remove samples) with the acquisition buffer? For example, a function which would return the latest ADC data or peeks in the acquisition buffer.
Thank you,
Andrei
09-15-2016 04:06 PM
I don't think you can do that directly. There are some intriguing little tricks to try with various DAQmx Read properties, but it seems that once you start venturing down that path, you'd probably get stuck doing all the read pointer management on your own.
I'd suggest that you manage these special "peeks" via software. The easiest thing is to retain the data from the most recent standard DAQmx Read somewhere and retrieve from that software storage location when there's a special request for a "peek" at recent data.
If the peeks require less lag time, then I'd suggest wrapping an Action Engine around the DAQmx Read call. That'll let you store & retain important info from the different kinds of DAQmx Reads that are done, and use it to make sure your standard reads delivers a continuous lossless data stream.
-Kevin P