--- continued from above ---
(5) Hmm.. so I now decide to figure out what this buffering business
is really about. I wire up Property Nodes inside the while-loop to
display Status before and after the DAQmx-Read.vi call. The status
includes CurrReadPos, AvailSamples, and SampReadPerChannel(?). Some
observations are listed below:
(5a) I suppose CurrReadPos is a pointer to buffer memory. However,
this pointer is somewhat abstracted given that it is not circular; it
is also a running counter of the number of samples read per channel;
it may exceed the size of the buffer. Or, in other words, could it
be that CurrReadPos mod the "Number of Samples" parameter for
DAQmx-Read.vi is the actual buffer index?
(5b) Running the program for approx the same time, setting a
timed-while-loop with a greater period would result in a larger ratio
of AvailSamples-vs-CurrReadPos. This is reasonable since the buffer
is continually being filled by a triggered acquisition that runs
independently of my program which merely reads "Number of Samples"
from the buffer on each iteration of the while-loop. If the
while-loop is too slow, the buffer will be overwritten. But..
(5bi) Does the AvailSample simply "run away" and increase indefinitely
compared to a modest buffer size? If this is so, then AvailSample
confounds the problem of keeping track of buffer pointers (if it is at
all possible!!).
(5bii) A little experiment: Set the buffer size to be a large number to
avoid buffer overwrite. While the ReadCurrPos and AvailSamples were
still much less than the buffer size, the waveforms acquired were
still out of phase. Hmmm... Is the buffer size limited to the
AnalogInput FIFO buffer size (4095 for the PCI-6251)?
(5biii) Okay. So set the buffer size to be 4095. Also set the "Number
of Samples" to be 4095. Assuming (if valid?) that the triggered
acquisition is much much faster than the looped DAQmx-Read.vi calls,
then each trigger will completely fill up the buffer AND each
DAQmx-Read will completely read (and clear) the buffer that now
contains the properly timed waveform... However, this is not the
case. The waveforms are still out of phase. Could it be that the
buffer is being overwritten while it is being read?? I also tried
such numbers as 128, 256, 512, and 1024. No luck.
(5biv) Perhaps I can change the RelativeTo and Offset Properties so that
I am reading from a better postion in the buffer. (i.e. setting
Offset to be the AvailSampl which effectively clears the buffer).
However, any such change, I soon discovered, would slow down the
program to a rate comparable to a "finite" sampling mode version. I
suspect that there is also some under-the-hood resetting which occurs
in this instance.
(5c) SampReadPerChannel is not an integer! What does this mean?
So from all of the confusion above, with all the tinkering of buffer, sample size, etc, I still wonder if it is possible to have a triggered continuous acquisition using DAQmx vi's that would preserve the waveform phase.
Finally,.. is there a way to get the traditional NI-DAQ VI's to work with the PCI-6251 (which is a DAQmx device)?
Thanks..