LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Questions about the execution logic of the finite sample task with cyclic reading

I'm not sure I understand the execution logic of the finite sampling task of cyclic read sampling correctly, and I think the official documentation is very vague in this regard.For example, for the program in the figure, I want to make sure whether there is a problem with my understanding:

 

First, the acquisition starts when Start Task VI is called. When the first loop is executed, Read VI waits for the number of points available in the buffer to reach 50 and reads them, and then enters the second loop. In the second loop, Read VI waits for the number of points available in the buffer to reach 50(start wait in buffer position when last read stop) and reads them, and then enters the third loop. In the third loop, since 100 points have been read, the finite sampling task is already automatically stopped (the number of sampling points reaches the number of sampling points set by Timing VI), and the finite sampling task is automatically started again when Read VI is executed (assuming the autostart property is set to True), and so on and so forth.

 

Is there something wrong with my understanding?

BTW, Does finite sampling use a circular buffer?

 

mmexport1684044539336 (1).png

 

0 Kudos
Message 1 of 2
(633 Views)

First, the acquisition starts when Start Task VI is called. When the first loop is executed, Read VI waits for the number of points available in the buffer to reach 50 and reads them, and then enters the second loop. In the second loop, Read VI waits for the number of points available in the buffer to reach 50(start wait in buffer position when last read stop) and reads them, and then enters the third loop.

Correct

 

In the third loop, since 100 points have been read, the finite sampling task is already automatically stopped (the number of sampling points reaches the number of sampling points set by Timing VI), and the finite sampling task is automatically started again when Read VI is executed (assuming the autostart property is set to True), and so on and so forth.

Incorrect. Error -200278 is thrown, which states that

Possible reason(s):

Attempted to read a sample beyond the final sample acquired. The acquisition has stopped, therefore the sample specified by the combination of position and offset will never be available.
Specify a position and offset which selects a sample up to, but not beyond, the final sample acquired. The final sample acquired can be determined by querying the total samples acquired after an acquisition has stopped.

You can Create Simulated NI-DAQmx Devices in NI MAX and reproduce the issue very easily yourself.

 

Once you have read all the samples, you need to restart the task to acquire more data, but no point doing that. You should acquire a large samples or use a continuous input task instead.

ZYOng_0-1684245540578.png

 

 

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 2 of 2
(578 Views)