Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Why is the frequency measurement locking up on my E-series card?

I'm trying to measure the input frequency on my E-series card (using Labview) but when I rapidly change the frequency the measurement locks up.  I think the software is working fine (one counter low frequency, DAQmx, etc).  If I re-start the task the frequency measurement comes back to normal.  I'm trying to measure a fairly low frequency (1 to 10,000 Hz) of a 5-volt square wave.
 
Any ideas?
 
Thanks.
0 Kudos
Message 1 of 5
(3,375 Views)

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

0 Kudos
Message 2 of 5
(3,365 Views)
I'm using LabView 7.1 and I've downloaded the latest version of MAX (not sure how to check for DAQmx version).   I'm using an HP frequency generator and measuring the frequency during the time I'm sweeping the frequency generator.  By "rapidly", all I'm doing is manually changing the frequency between the ranges of 1kHz to 4kHz within a second or two, no discontinuity, just going through various frequencies.  The lock-up doesn't seem to happen at a specific frequency or frequency range.  In fact, eventually it even locks-up without changing the frequency, but the variation seems to make the problem worse.  I've seen it lock up anywhere from 1kHz to 8kHz.  I don't need to measure anything higher than 10kHz so I was hoping to get this done with one counter (the other counter is also being used).
 
Can you tell me what the maximum range is for the "Low Frequency 1 Counter Mode"?  What are the min/max settings doing for the DAQmx CI Freq task?  These settings do not seem to limit the frequency???  Keep in mind that these are separate questions, I've set the min/max values correctly and still have the problem...
 
Hopefully this additional information is helpful, I'll also have a look at your links later today.
 
Thanks
0 Kudos
Message 3 of 5
(3,357 Views)
It is not hardware!  Apparently the task is stopping because at frequencies that are much higher than my analog input data, also in the loop, there are too many samples to be read on the frequency channel.  According to the help, I could overwrite samples not read but so far that has not worked.  I've tried a read property with overwrite, relative to most recent, and an offset of -1.  No go...
 
Any suggestions?
 
Thanks.
0 Kudos
Message 4 of 5
(3,352 Views)

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???

0 Kudos
Message 5 of 5
(3,339 Views)