09-24-2021 01:21 PM
Thanks for the feedback, Gerd. I will adjust my methodology and separate functions as much as possible going forward. For context, I'm capturing on the order of 1 kS/s.
To be clear, you're suggesting the following:
Correct?
Is it OK that I display data to front panel within the DAQ loop? What is a better practice?
09-24-2021 06:29 PM
I looked up the X-series manual to point you to more description, and dang it! What the X-series can do isn't particularly special after all. It's mostly just a more friendly API for a method that worked 20 years ago with E-series devices. It's really only suitable for situations where your frequency is very much higher than your desired sample rate. Quantization error follows this ratio directly -- if freq is 20x the sample rate, quantization error is 1 part in 20 or 5%.
I guess I was thinking of a more truly new method known as "dynamic averaging" that I only know to be available in a particular cDAQ counter module (the 9361 I think?).
So you're probably better off using your existing "Implicit" measurement mode where the sample rate *is* the measured (and variable) frequencies. And then put together some code to properly deal with your sometimes-expected timeout errors.
-Kevin P
09-29-2021 06:08 PM
Thanks for the extra context tho, Kevin!
09-29-2021 06:17 PM
Gerd, thanks so much for all your help. I implemented all your recommendations and the averaging works just like I wanted it to. I especially appreciate your logic involving the average button and the counter. I see how it enables summing to continue even after the button resets.
I will clean up my main VI & sub VIs and post in this thread for others to use.
I really appreciate your time!