LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simple Start Analog Edge trigger doesn't work

Solved!
Go to solution

Much thanks for your generous tutoring, all. I can see that reading the Daqmx manual front to back is in my near future...

0 Kudos
Message 11 of 13
(820 Views)
Solution
Accepted by PaulOfElora

A really helpful reply by BertMcMahan in msg #10.  Just adding a small note to be extra clear about one specific detail, because it seems to come up a lot.

 


@BertMcMahan wrote:

If your DAQmx Read call specifies -1 samples, it reads the whole buffer (if it's empty, it reads 0 elements)...


A call to DAQmx Read specifying -1 samples can have different behavior depending on Finite vs. Continuous Sampling.

 

Finite Sampling:

    The DAQmx Read call will (intend to) return the entire buffer full of samples.  (The buffer size was defined during the call to DAQmx Timing.)  If the buffer hasn't been filled yet, the call will block until the buffer *does* fill, or until the timeout period has elapsed.

 

Continuous Sampling:

    The DAQmx Read call will immediately return "all available" samples.  The call will not block, nor will it timeout.  If 0 samples are available, it will happily return 0 samples back with no error.

    The notion of "available" pretty much means "samples in the buffer that have not yet been retrieved with a prior call to DAQmx Read."   The first sample returned in this call to DAQmx Read is the very next sample after the last sample returned in the previous call.  (There are advanced ways to manipulate this behavior.  Let's not confuse things by getting into it right now.)

    The fixed-size buffer is *treated like* a circular buffer by the DAQmx driver, which keeps track of insertion points, retrieval points, and wraparound.  The size of the buffer is at least as big as what was requested in the call to DAQmx Timing, but it may be bigger, according to fixed rules.  (Not mentioned in the linked article is the fact that DAQmx actually uses the *larger* of your requested size or the auto-calculated size.)

 

 

-Kevin P

Message 12 of 13
(811 Views)
Solution
Accepted by PaulOfElora

Fired that puppy up after giving the DAQmx Read # of samples, and it works like a champ!  Again, thanks for all your kind help with my education - paul

0 Kudos
Message 13 of 13
(795 Views)