LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sample frequency

I am measuring pressure data and write them to a file with the enclosed vi. My troubles are that I want to have up to 100 samples every second, and write the data to a file to do some frequensy analysis. But I cannot get a higher rate than 20Hz, and the number of data point in the file varies a lot when I do a 1 minute run. Then I cannot be sure on the sampling frequency or if they are sampled with constant frequency.
Can anyone help me?
0 Kudos
Message 1 of 4
(2,861 Views)
The problem here is that you are using the single point acquisition VI. Since your loop is running in software, it is a slave to the OS and its timing is affected by all other processes running on your system. What you need is buffered acquisition so that you have hardware timing instead. The good news is that there are several examples that ship with LabVIEW that can do exactly what you want. Find the VI called "Cont Acq to File (scaled).vi" at the following path.

..../LabVIEW/examples/daq/anlogin/STRMDISK.llb/

If you'd like something done much more professional so you can have a good example, contact an Alliance Member. We do this stuff every day.

Daniel L. Press
PrimeTest Corp.
www.primetest.com
Message 2 of 4
(2,861 Views)
Than you for the answer, I think the example will solve my headache this time.

I was worried it had to do with the computer, I'm running on an old 166MHz laptop.. I have another vi which also uses the single point acquisition, but here I have 4 inputs and one output. The frequency is not so high here, 10Hz max. So, is my saved data also affected here by not being sampled at a constant frequency(means crap..). Will it be better if I get a new and fast computer? or do I have to rewrite my vi?

Lars
0 Kudos
Message 3 of 4
(2,861 Views)
To get a constant sampling frequency, you really need to let the DAQ hardware do the timing. To the best of my knowledge, the version of your VI here should do the trick. Note that the scan frequency is now defined as a DAQ input. This is the version already suggested by Photon Dan (if I have correctly understood). The card sends the data into memory (independent of the OS), allowing LabVIEW to read it whenever the processor isn`t busy doing something else.

With the continuous scan, it`s important to wire the iteration input, this way the initialisation is done only once instead every time the loop iterates.

Hope this helps

Shane
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Message 4 of 4
(2,861 Views)