LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sample rate

Solved!
Go to solution

Hello,

my company is currently in the proccess of converting to Compact DAQ to replace our aging NI2070/2050 systems. 

We are using cDAQ9174s with 9205 AI modules and LabVIEW 13.0.1.

 

What I'm running into is a slow sampling issue. Attached is the sub .vi that we're using to gather signal. Now with our old system, we'd take the output of this .vi and run it through a mean function to get the mean average of 100 readings. We used this as a form of signal processing to get a stable output. This worked well for us and we would get multiple measurements per second.

With the cDAQ though, it's taking a couple seconds per reading. Even lowering the amount of samples to average from 100 to 10 only yields us about one measurement per second. 

This is using 1 Sample On Demand. I've also tried N Samples and played around with different sample sizes and rates to no avail.

Now if I open up the test panel in NIMAX, the readings fly in. Which makes me think there's some setting I'm missing in LabVIEW that needs to be changed with our new hardware.

 

Thoughts?
Thank in advance!

Aaron

0 Kudos
Message 1 of 4
(3,418 Views)

What is interesting is that, how your old system was able to perform good using this cursed DAQ Assistant. If you want to program NI hardware properly, do not use DAQ Assistant! It initializes and releases HW at every iteration! Use proper DAQmx functions! Create/start task BEFORE the loop, and only stop it AFTER! You should have only the "DAQmx Read.vi" function inside the loop.

 

edit: but i have no idea what you try to do in this FOR loop? How many times do you iterate that FOR loop? I really advice you to learn how to properly decouple your DAQ tasks from your signal analysis. The trick is called "Producer/consumer" design...

Message 2 of 4
(3,396 Views)
Solution
Accepted by Aaron_K

I think what we are seeing here is a difference in latency between PCI (what the old boards used) and USB (what the cDAQ is using).  I will say that in almost every application I have done, the 1 sample on demand is NOT what is really needed.  You want to use continuous sampling so that the sampling rate is constant.  You can then read your 100 samples at a time and perform the average on those.


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 3 of 4
(3,378 Views)

Continuous sampling seems to have sovled the problem, thanks!

0 Kudos
Message 4 of 4
(3,274 Views)