03-12-2008 01:25 PM
03-13-2008 04:48 PM
Hello Phil,
In order to make a frequency measurement with the USB-6009 you will need to count the pulses and then use software timing to determine the elapsed time. Many of the multifunction data acquisition (DAQ) cards are capable of directly measuring frequency, but for the USB-6009 the only supported counter input measurement is edge counting.
There is an example that demonstrates how to use the USB-6009 to count events. Here's how you can access this example:
1. Open LabVIEW.
2. Go to Help>> Find Examples...
3. Navigate to Hardware Input and Output>> DAQmx>> Counter Measurements>> Count Digital Events>> Count Digital Events.vi
This VI will run on the USB-6009 if you change the "Edge" control on the front panel to "Falling."
You can modify this example to calculate the frequency in software by using a "Get Date/Time in Seconds" VI. Use this VI to get a timestamp before you enter the loop and then put another copy of the VI inside the loop so you can get a timestamp each iteration. If you divide the count by the difference in these two timestamps you'll get an estimate of the frequency. You can also use a shift registers to calculate the frequency on an iteration by iteration basis.
This method uses software timing so it’s not nearly as accurate as the counter input frequency tasks available on some of our other products. This method will work, but it won't be able to measure changing frequencies very well. I would test it out and see if the results on your computer are acceptable for your application. If you find that they aren't accurate enough then you may want to consider getting an M Series DAQ card to implement a frequency measurement in hardware.
I hope this helps, and have a great night!
Cheers,
03-13-2008 07:46 PM
03-15-2008 10:08 PM - edited 03-15-2008 10:10 PM
06-29-2009 07:49 AM
Hi Kent,
I have the same requirement to count the Frequency of the digital signals coming on the Line 0, 1, 2, 3, 4, 5, 6, 7 (Port 0 of USB 6009).
But the problem is I have to count the samples simultaneously on all lines.
I guess, I have to physically connect a wire between the Line I/P and Counter Input PFI0 (which will start from the Line number under measurement and terminate to the Counter I/P) in order to have the fequency measurement because Internal switching is not available in USB 6009.
Can it be possible with USB 6009 as it has only one Counter I/P PFI0 and i can not be able to switch from one line to another programatically.
PWM measurement is also required.
Can I measure the frequency without counter, i know it will be not as much as accurate but this is the requirement.
Please suggest any solution or render any made vi.
Regards,
Samriddh Sarbalhi
06-30-2009 07:17 PM
Samriddh,
The USB 6009 only has one counter, so this will only work to measure the frequency of one signal. Without a counter you will have to read the signal in and then do post processing to find the frequency. (You can use the Timing and Transition VI.)
-Christina
06-30-2009 11:37 PM
Hi Christina,
I had made a vi in which i am measuring the frequency by having the known number of samples of the signal and then averaging out and processing the values as per frequency formula 1/t=frequency (without counter use of USB 6009).
This method is working fine for low frequencies but for high frequencies it is not showing any accurate results.
Can you provide me any readymade code.
It is known to me that i have to ignore or discard counter available in USB 6009 in order to have simultaneous measurements on different lines of 6009.
What about PWM Measurement?
Regards,
Samriddh Sarbalhi
07-01-2009 02:31 PM
Hey Samriddh,
I believe the problem you are seeing is due to the laws of the Nyquest Theorem. If you can not sample your signal fast enough, you are likely missing counts. If I had to guess I would assume that at higher frequencies of your signal, the frequency that your code outputs is less than the actual frequency you are inputting. One way to get around this would be to sample from you device faster. Unfortunately, the 6009 is limited to 48 Ks/s. So for sampling faster frequencies, you are going to have trouble because of this limitation.
Out of curiosity, what is the threshold where you go from accurate frequency readings to inaccurate readings?