04-02-2007 07:50 PM
04-03-2007 10:36 AM
Hello.
Thank you for posting to the NI Discussion Forums.
In order to provide you with the best service possible, I would like some additional information. First, what versions of LabVIEW and DAQmx are you using? Secondly, can you quantify the statement "rapidly change the frequency." What is the starting and ending frequency and how fast does this change take place? Does this change take place as you are actively measuring the frequency of the signal? Posting a pared down version of your code that reproduces the behavior could also be beneficial to our efforts.
There are numerous ways to take a frequency measurement with counters. I would recommend looking at the following dev zone article below for some additional information as well as exploring the use of 2 counters for more accurate measurements in the second link.
Making Accurate Frequency Measurements
http://zone.ni.com/devzone/cda/tut/p/id/3619
DAQmx - Measure High Frequency 2 Counter Method
http://zone.ni.com/devzone/cda/epd/p/id/2413
Let me know if this helps.
Brian F
Applications Engineer
National Instruments
04-03-2007 01:12 PM
04-03-2007 05:46 PM
04-04-2007 11:09 AM
Now that I have a better understanding of the problem, here is a modified example that has the same issue as my acre-sized Labview program. Note that in my program I have buffered AI reads that are recording multiple data points per loop iteration. I need to run buffered frequency measurements (which requires Implicit timing) so that I can check if there is an available sample in the frequency buffer. This check allows me to input very low frequencies (like 1 Hz) and if there is no available point, I just use the point(s) provided in the last loop iteration. This allows the loop to continue without waiting for a calculation of very low frequency inputs. Otherwise my loop waits for a frequency point to become available and my AI gets bogged down.
So I'm stuck with buffered frequency measurements to deal with low input frequencies, this works great for low frequencies. When I put in high frequencies, like 1000Hz, 10000Hz, etc I get an error that says that the task was stopped because there was un-read data in the buffer - seeming to ignore the "Overwrite Unread Samples" request. Why won't this overwrite the samples that accumulate at high frequencies.
Also note that if I remove Implicit timing and don't do buffered acquisition, the high frequencies work great. Then I have a problem with low frequencies…
I can't change modes based on input frequencies. I don't want to increase the AI rate based on input frequency. There must be a way to ignore (overwrite) the extra frequency samples without getting an error???