11-27-2007 09:22 PM
11-27-2007 11:51 PM
11-29-2007 08:53 AM
Hi,
Please try the 2 Counter (large range) measurement method inside the DAQ Assistant. This method will use one counter to divide down the counter input and the other to measure the input. The divisor should be set to the number of periods used to calculate the frequency of the unknown signal. Since there is a large range, please select the divisor based on the higher value. A larger value will produce a more accurate measurement, however too large of a value might cause the count register to roll over.
There is also a helpful example titled Measure Digital Frequency – Buffered – Continuous – Large Range 2 Counter. This example is located under <Help> <Find Examples> <Browse Tab> <Hardware Input and Output> <DAQmx> <Counter Measurements> <Digital Frequency>. This example is going to do the same thing as the DAQ Assistant, but will be more efficient. The example program only loops the DAQmx read.vi, where the DAQ Assistant is looping the entire process. This might also help save some processing time.
11-29-2007 10:56 AM
There are going to be trade-offs when you try to handle such a wide range of possible input frequencies. There is some excellent in-depth info available here. 3 related examples are given here.
Here's a general thought if you want your software to update its frequency reading at a constant rate of, say, 10 times a second for example.
Put your frequency-querying code in a loop that's timed to run 10 times a second. This may be an official Timed Loop or could be a while loop containing a "Wait for msec multiple" time delay function. Before calling DAQmx Read, first call a DAQmx Read property node to query for the # of available samples. If that # is 0, then skip the call to DAQmx read and report a "0" frequency for that loop cycle. If the number is > 0, read them all and use the latest one(s) to report your frequency. The specifics will vary with which of the 3 methods you choose for measuring frequency / period.
Finally, note that any of this in-depth programming will require that you wean yourself away from the DAQ Assistant and do more of the DAQ programming manually. Studying the examples will be a huge head-start.
-Kevin P.