LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to do continuous acquisition, but truncate 30% of samples every loop?

Hello,

I am trying to do a continuous multi-channel acquisition in a while loop, similar to the example shown below. However, on every iteration of the while loop, I use the digital output channels P0.0-P0.7 to set some conditions. The problem is that after I set the conditions, the external instrumentation needs a few milliseconds to settle. I am envisioning to acquire samples for ca. 500 milliseconds on each loop. How can I accommodate a settling time of, say, 50 milliseconds on each iteration of the loop, before generating an actual measurement point?

1.) I first tried to put a delay timer in the loop, but that just delays execution, not acquisition, and eventually the buffer overflows.

2.) Maybe I could start the task inside the loop with a trigger, which incorporates a delay? However, I generally prefer to not re-start the task on every loop execution, because this can introduce timing uncertainties, and it also adds to the CPU load.

3.) Another approach might be to acquire all data continuously, but chop off the first ca. 10% of acquired samples. How would I do that?

Which approach is most efficient? How would you implement it?

Thanks!






0 Kudos
Message 1 of 8
(3,588 Views)
I don't see the digital out code in your image.
 
To make things occur in the right order and with the desired delays, write your digital line, then wire the error cluster through a 50ms delay, and then to the analog in. The datadependency of the error cluster will now force the execution order and timing.
 
For the delay, you could use a "time delay" from the express (exec control) palette.
 
0 Kudos
Message 2 of 8
(3,562 Views)
It also seems to me that you don't want to do continuous acquistion. Doing finite samples, you could set the digital, delay, and then acquire without getting an error. Repeat. You might also want to do a triggered acquisition.
0 Kudos
Message 3 of 8
(3,552 Views)
Yeah, listen to Dennis. (I am not much of a DAQ guy ;))
0 Kudos
Message 4 of 8
(3,547 Views)
Thanks for your answers. The suggestion to add the "time delay" express VI into the error loop is particularly interesting. I tried to do exactly that - see attachments.

However, I now have data timeout problems with the acquisiton.

In continuous mode, the buffer overflows after a minute or so.

In finite sample mode, an error is generated that the sample if interest can't be found.

How can I fix this? The examples are version 7.1, so should be easy to open.

Thanks!




Message Edited by Gustep on 05-30-2008 03:21 AM

Message Edited by Gustep on 05-30-2008 03:23 AM

Message Edited by Gustep on 05-30-2008 03:23 AM

Message Edited by Gustep on 05-30-2008 03:23 AM
0 Kudos
Message 5 of 8
(3,514 Views)
With the time delay, the buffer overflow is to be expected. You did not post an example with finite sampling. What is the exact error code that you get when you do that?
0 Kudos
Message 6 of 8
(3,497 Views)
Hi Dennis,

Thanks for your reply. For finite sampling, I used the exact same VI, just set to "finite samples" on the DAQmx Timing VI.


0 Kudos
Message 7 of 8
(3,481 Views)

Hello Gustep,

 

Dennis has a good idea.  I would recommend using a finite acquisition.  The only change you'll need to make is to start and stop the analog input task each loop iteration after you acquire the number of points you want.  Here's a screen shot of what I would change:

 

 

Basically I moved the DAQmx Start Task VI inside the loop after the delay and I added a DAQmx Stop Task after the DAQmx Read VI.  Other than that the only change was from continuous to finite samples on the DAQmx Timing VI.

Cheers,



Message Edited by Brooks_C on 06-02-2008 02:46 PM
Brooks
0 Kudos
Message 8 of 8
(3,451 Views)