03-10-2011 12:43 AM
Trying to accomplish the following with no luck so far:
Setup a a DAQmx read buffer in a way such that
If I am truly asynchronous, I should be getting the most recent samples (some of which may or may not be 'old' or read by the previous call)with no delay at whatever times I choose to call DAQmx Read. So far, I am getting a dleay consistent with a half-buffers worth of data.
Playing with the follwoing settings didn't get me what I was looking for. I thought the following combination might work:
Overwrite Unread Samples
Read Relative to Most recent
Read size = buffer size/2
I can do all this separately without the DAQ buffer; that is not the issue. Call it an exercise if you like - I'm just curious if it can be done with the DAQmx read buffer.
I guess what I'm really asking is if the Read Position pointer can be ignored.
Solved! Go to Solution.
03-11-2011 09:08 AM
You are absolutely on the right track. I've done many apps with this kind of requirement -- data acq hw is always scanning into and overwriting their RAM buffers, various parallel processes can request a chunk of "most recent data" at any time.
There's just one DAQmx property you didn't mention, so I can only guess that's where the problem is. When you drop down the
DAQmx Read property node to specify "relative to most recent", expand to the next property "Offset." Here's how it works: to read the N most recent samples, specify Offset==negative N, and wire N to the following DAQmx Read call
.
-Kevin P
03-11-2011 10:03 AM - edited 03-11-2011 10:10 AM
That works really well, thank you.