LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

understanding finite samples

In my application, there are bursts of sampling (on the order of 10 milliseconds) with long quiet intervals (on the order of seconds) in between.  I'm trying to understand how to structure my loop.  It seems that "finite samples" is the appropriate way to set up my task clocking.  Now, questions:

 

  1. Should I call Start Task once per group of samples to be collected, or just once in the beginning?
  2. If I set "number of samples per channel" to -1, I get 1000 samples, but I don't know why.  What in the system would be telling it how many samples to get, or how long to wait for them?
  3. When I press the stop button, ending my While loop, I get error -200278, saying that it "Attempted to Read Sample: 1000".  This number corresponds to the requested rate, but not to the number of samples per channel being used in this particular experiment; that number is much smaller.  It seems almost as if the read tried to take place after the loop stopped and the task was being closed.  But I don't understand how that could happen.  The Stop button is attached only to the loop exit terminal, and the task is closed only after the loop has exited.

Along with specific answers, I would be very happy to be pointed to reference material that gives a good explanation of using finite samples.

 

Thanks in advance,

Ken

0 Kudos
Message 1 of 2
(2,631 Views)

Hello Ken,

 

1. What device are you using? The X Series DAQ allows for retriggerable Acquisition. The Acq&Graph Voltage-Int Clk-Retriggerable.vi  can be found in the Example Finder. If you are using an M or E Series card, the Finite Retriggerable Analog Input Using Digital Trigger should suit your application.

2. When the number of samples per channel is set to -1, the vi waits for the task to acquire those samples. There is a property node "Read All Available Data that allows you to control whether or not to read directly from the buffer without waiting for the defined number of samples. 

3. Error -200278 at DAQmx Read, provides some explanation.

 

Regards,

Glenn


Regards,
Glenn
0 Kudos
Message 2 of 2
(2,612 Views)