LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Maximizing NI 6002 Sample Rate

Solved!
Go to solution

Hello Everyone,

 

I am using an NI 6002 to measure voltage across two channels. I am using a shift register to initially save the values in memory and then after 20 minutes of data collection I am writing them to a text file. I am currently writing approximately 140 samples/sec to a text file.

 

I am not sure how to properly increase my sample rate. I have been iteratively changing the inputs into DAQ Assist and checking the sample rate by running my VI. I would like a more direct method of increasing my sample rate. Is there an equation I can reference?  It would be fantastic if I could write 500+ sample/sec to a text file. The NI 6002 is the only board I have available to me, so purchasing better equipment is not an option.

 

Linked below are images of my block diagram, front panel, and the DAQ Assist GUI.

 

https://imgur.com/a/u96vb

 

Any Information Would Be Appreciated!

0 Kudos
Message 1 of 7
(3,448 Views)

You should be able to get 2 channels at a 25kS/s.  Are you getting an error?  You might want to look into a Producer/Consumer setup to save some memory and log the data while you acquire it.


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
0 Kudos
Message 2 of 7
(3,418 Views)

Putting aside some design problems (possible greedy loop and an array that has potential to grow unchecked)

 

The best way to get a faster rate is by getting rid of the DAQ Assistant and using DAQmx functions directly. Set up your channels outside the loop, then read 1 sample/channel in the loop. If you really want to maximize the rate you have the potential to read 50,000 samples per second (25,000 for two channels) with that hardware, but it's unlikely you are going to be able to do that and display, and store all that for 20 minutes. 

0 Kudos
Message 3 of 7
(3,413 Views)

I am not getting an error when I run my VI. With my current inputs am I getting 25kS/s? Because my current VI only writes around 140 samples to a text file. Does samples/sec not equal samples written to the text file? 

 

I am new to LabVIEW as you can tell. 

0 Kudos
Message 4 of 7
(3,410 Views)

I just learned about the DAQmx functions in my Thermal Fluids Class. I will try to implement those. 

 

In the mean time, how can I the write more samples/sec to an text file using DAQ Assist? 

0 Kudos
Message 5 of 7
(3,409 Views)
Solution
Accepted by topic author KurtzC1

Well something is acting like a bottleneck in that loop. There is an Elapsed Time express VI that I can't see the settings on and the DAQmx assistant express VI. So my guess is one of those two. Keep in mind that since that express VI is inside the loop it is probably setting up the channels every iteration of the loop. That was why I was saying set the channels up outside the loop so the only thing that happens every iteration is grabbing a reading.

Message 6 of 7
(3,402 Views)

WOW... well that definitely fixed it. Holy hell I wrote 1.79 MB of data in one second. Thank you so much!

0 Kudos
Message 7 of 7
(3,395 Views)