LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to acquire 512 or 1024 data at given period?

Attached is a example how I acquire 1024 data points from DAQ Card. How do I make it to acquire the same amount of data points over 0.5 sec let say? I have the idea of putting in a delay in the loop but I felt there must be other precise way to do this.

Any suggestion?
0 Kudos
Message 1 of 8
(2,796 Views)
Ah forgot to tell that I am using old PCI-MIO-16E-4 version of DAQ Card.

http://sine.ni.com/nips/cds/view/p/lang/en/nid/10795

I figure this card is fast enough to do the above slow acquisition

0 Kudos
Message 2 of 8
(2,787 Views)
I don't understand the picture. The way to acquire so many data points over so much time is with setting the sample rate and number of samples on the DAQ board. If you want 1000 points a second, the sample rate is set to 1000 scans per second and the number of samples would be the same. If you want to acquire the same number of points in half a second, the same rate would be doubled to 2000 scans per second. If you are aquiring a single point at a time in a while loop, then you are depending on software timing and that's not very accurate.
0 Kudos
Message 3 of 8
(2,786 Views)
Yes, I understand that from hardware point of view. I would like to take precise 1024 data points in software now, over a period of given period. The reason I need this to be precise is because I need to synchronise with other machinery after the completion of the above task. I do not want the For Loop to finish acquiring all 1024 data points in less or more than 0.5 sec. Thus I need to control the acquisition timing. Noticed there is an array there to accumulate the data points. To enter the data into array, I need to loop it with For Loop. If there is any better way of acquiring data, please suggest. Thanks
0 Kudos
Message 4 of 8
(2,782 Views)
Why do you have to do it with software timing? The timed loop could be tried but unless you use timing from the DAQ board, the best resolution you have is 1 msec and that's not good enoogh. To use hardware timing, I believe it requires DAQmx but I don't know if your board is supported with DAQmx. If you really want to control the acquisition timing, then control it with the hardware and the array will be automatically created for you - no for loop required. If you need precise and deterministic timing behavior with software, you can't be running on windows. Move up to LabVIEW Real-Time.
0 Kudos
Message 5 of 8
(2,779 Views)
Advice noted. I will need to check whether mine support DAQmx, but I believe so as I saw it under the Test and Measurement panel. I will try out 1st and come back to this board if I stuck on this problem. I am quite new to this and most of the code I learn it by trial and error. At least I know now that Windows environment is not that reliable. No pun intended 🙂
0 Kudos
Message 6 of 8
(2,775 Views)
Hi,

Just to add to Dennis' comments, it would appear that you just need to setup a finite acquisition with the rate, samples to read etc. setup to suit your requirements. This will in effect give you an array of data which you can then use as you will, such as aligning with other data for correlation etc.

As an example as to why you shouldn't try this using software timing under Windows, should someone start moving the mouse around, opening another application etc. this could effect the loop timing as Windows always has overall priority. Using the hardware timing of your DAQ device would avoid this.
0 Kudos
Message 7 of 8
(2,760 Views)
The DAQ device you mention can use either driver (DAQmx or Traditional DAQ).

I would strongly recommend using DAQmx.
0 Kudos
Message 8 of 8
(2,759 Views)