Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Daq Assistant acquires data in chunks

Solved!
Go to solution

I am trying to write a code that will read and record voltage, temperature and strain on a cdaq 9174 using ni 9221 and ni 9173 cards.  The problem is that when the daq assistant is set to N samples it outputs chunks of data in the graphs.  I would like it to be a continuous stream so I can see what is actually happening.  I have tried changing it to continuous but it either gets an error or takes around 16000 data points in about 10 secs which is way more than I would prefer.  The code I am using is borrowed from someone else and when setting it up exactly the same it works on that computer, but not mine.  Does anyone have any suggestions on how to solve this problem.  I have attached the code as well as the sub vis that is uses.

Download All
0 Kudos
Message 1 of 7
(3,696 Views)

Here is the last sub vi

0 Kudos
Message 2 of 7
(3,694 Views)

Hi fwowe,

 

Thanks for joining the forums! Smiley Happy

 

- What have you set for the Max Refresh Rate and Sample Rate when you are running the program?

 

This will define how often your indictor updates.  For example, if you are acquiring 1000 data points at 500 Hz (samples/sec) - this will update once every 2 seconds.  To increase the rate of update, lower the points to be read, or increase the sample rate.


Regards,

Peter D

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

One other quick thing, it makes it easier to help if you place all your VIs in a zipped folder when you are attaching them Smiley Happy


Regards,

Peter D

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

Thanks for the advice I initially set the sample rate at 500 and the max refresh rate at 5.  I have played around with them trying different combinations.  The problem is the total data points behave as expected but with N samples the graphs are to choppy to be useful and with continuous there are too many data points when running a long test.

 

Is there maybe another way to display the data that would work better or am I just going to have to accept either bad graphs or a lot of data points?

0 Kudos
Message 5 of 7
(3,676 Views)

With continuous sampling, your sample rate should determine how many samples you're acquiring every second. If you intend to run this for a long time, you might want to try lowering that sample rate to what you want. You're saying the "total data points behave as expected" but that when continuous, there are too many data points since your test is long. How long are you running the test, and how many data points do you intend to have over the course of the test?

 

The reason your data comes out in chunks when using N samples is that when you use that setting, you don't need to use a while loop. It collects all "N" samples at once. So in a while loop, each time through the loop, you collect N samples, and it dumps all of those in your chart at once, thus the "chunk." Each chunk is one iteration of the while loop. On the other hand, continuous sampling requires a while loop because the DAQ Assistant "adjusts" the while loop's firing rate appropriately to collect samples at the right rate.

Ravi A.
National Instruments | Applications Engineer
0 Kudos
Message 6 of 7
(3,650 Views)
Solution
Accepted by topic author fwowe

Thanks for all the help.  I didnt realize at first that the NI 9237 card has a minimum sampling rate of ~1600 Hz.  I am now able to sample at 2000 Hz then use continuous decimating to write to my file at 200 Hz.

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