LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Increasing Number of Samples Taken per Second

Solved!
Go to solution

So I'm a beginner in LabVIEW, and I'm working a program to help me with some research. I have attached my VI below, and I'm taking data at a rate of about 2000 samples per second (using the time delay express VI set at .001s). However, I need to be taking data at about 10,000 samples per second, but if I try to simply decrease the amount of delay (down to .0001s), the sampling rate doesn't increase. Does anyone have any thoughts/solutions to help me out? Thanks.

0 Kudos
Message 1 of 5
(3,125 Views)
Windows cant handle such small delays. I cant look at the code right now, so general respons.
You typically set up a daq task with x sample frequency and a buffer. You read out the buffer e.g. 20 times/sec to show in a graph.
/Y
G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 5
(3,118 Views)

It would be expected that someone with a username fo "kronos.." would understand time.....

 

1. If you open the front panel of the Time Delay Express VI and look at the block diagrams insde your find this:

 

Tiem delay.png

The resolution of the Wait (ms) function is 1 millisecond. So you cannot get any specified delays shorter than that.

 

Two things you can do to get much faster data acquistion (assuming your DAQ devices is capable):

1. Use hardware timing on the DAQ board. Almost all boards can sample at 10000 samples per second and many are much faster. Set the sample rate to 10000 samples per second and read 1000 or 2000 samples on each call to the Read VI. No delays are required in your loop because the DAQ Read will wait for the specified number of samples.

2. Use a Producer/Consumer (data) architecture so that the DAQ read is in one loop and the file writes are in a parallel loop. This prevents any slow downs due to the file system or the OS from blocking the DAQ reads.

 

It is also faster to use the low level DAQ drivers. That avoids the overhead in the DAQ Assistant.

 

Lynn

0 Kudos
Message 3 of 5
(3,113 Views)
Solution
Accepted by topic author kronos5340

Use the Example Finder and search for the "Voltage - Continuous Input.vi".  It is a good example of a basic acquisition.  There is also a built-in function of DAQmx called Configure Logging.  When enabled, DAQmx will automagically log the task data to a TDMS file for you.  Use the continuous acquisition and set the sample rate to your desired rate.  You will need to read multiple samples to keep up.  But that example is an excelent place to start.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 5
(3,104 Views)

Thanks for your help! I had to upgrade the NI-DAQmx to version 9.0 for it to work. It's now running smoothly 🙂

0 Kudos
Message 5 of 5
(3,068 Views)