Dynamic Signal Acquisition

cancel
Showing results for 
Search instead for 
Did you mean: 

Starting task means starting acquisition and reading or only acquisition?

Suppose i use the DAQmx Read.vi before starting a task will the vi read from the buffer already stored data or do i have to start the task again to read the data in the buffer if so then will the acquisition will be triggered when i start the task?
Please clarify this doubt of mine.
Elaborating with an Example
I Have created a virtual channel with continuous sampling with sampling rate of 1000Samples/ S my signal frequency is say only 1Hz, the buffer size is 4000 Samples i do this all using DAQmx vi's to get a newly created task. Now I aquire for 2 seconds assuming my acquisition starts as soon as i start the task inside the while loop i do the reading of samples from the buffer at a slower rate say 100 samples/sec. So in turn i must run the while loop at least for 10 times to acquire all the samples assuming now that the while loop executes at 100ms so by 10 iteration it would have run for 1 second in this case my acquisition will acquire the new data samples an throw it in the buffer. If the execution of while loop is improper or does not execute at 100ms then i might end up losing data or acquiring more data.
All i want to know is
1. Does the start task mean starting acquistion.
2. Do we have to start a task to read samples from the buffer.
Thanks
Bye
K.Narayanan
0 Kudos
Message 1 of 2
(6,611 Views)
Hi Naru,

Basically a task always requires a trigger in order to begin.  That trigger is either a hardware trigger like a rising digital edge as created in the "DAQmx Trigger.vi" or it can be a software trigger such as using the DAQmx Start.vi.

That being said, it sounds like what you are trying to do is read a finite amount of data.  If you set up your measurement as finite, then you will not lose any data samples because the software is taking time processing the data that is already acquired.  I think the best idea is to do something like I did in the attached example.  Simply read the number of samples you want for the necessary number of iterations.  You will not lose any data because the data is actually loaded onto the hardware buffer and pulled off of there in the desired chunks.

Try it out,
Message 2 of 2
(6,597 Views)