Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Sine Wave Frequency Measurement with HW Triggering

Hey everyone, I have a PCI-6110 and I need to accurately and quickly measure the frequency of an analog input signal. The signal is a clean sine wave. I would prefer to do this with HW triggering, but SW would be fine. This is what I know so far: I need to connect my analog signal to the PFI0/TRIG1 connector, the trigger needs to be software configured, the trigger signal comes out somewhere and needs to be wired to one of the counters. That's all I know. Ultimately, I'm looking for a frequency change in the signal and the time that it occurs. Thanks for your help.

Darren
0 Kudos
Message 1 of 5
(3,458 Views)
The attached VI should give you an idea of one way to accomplish this. By default, the VI is using an analog input channel to measure the frequency using the analog trigger circuitry, but the block diagram shows how to use PFI0 instead. The trigger circuitry is configured to recognize changes in the input signal when it rises above the zero level crossing. This will create a reference point on your input signal at the zero level crossing as it rises above zero volts. The output of the analog trigger circuit is then routed as the input terminal for a buffered frequency measurment task. This will give you an array of frequency measurments for each period of your waveform. You can then traverse this array to find the points in time where the signal cha
nged frequencies. If the frequency of the input signal is too fast for the counter task to keep up with using the Low Frequency with 1 Counter method, try switching to the High Frequency with 2 Counters measurement method.
Message 2 of 5
(3,458 Views)
Hey Reddog, thanks for the response and the program. I'm mildly confused but I think I'll be able to figure it out sooner or later. I'm having trouble with physical connections; where do I connect things? Also, I'd like to scale this project up and measure the frequency of two signals simultaneously. Can I still use the same method? Again, thanks for your help.

Darren
0 Kudos
Message 3 of 5
(3,458 Views)
Nevermind, I'm an idiot. I just tried it again and realized all you have to do is connect the signal to the analog input. Sorry, it's Monday. However, my question about the simultaneous sampling still stands. Thanks.

Darren
0 Kudos
Message 4 of 5
(3,458 Views)
The method I showed you uses the analog trigger circuitry and a counter to measure the frequency of the analog signal in hardware. Since there is only one analog trigger circuit per board, you will need to add an additional device for each signal you want to measure.

Alternatively, you could acquire the signals using an AI task and then post process the data in software. Since you know the rate at which you're acquiring data, you can search for the zero crossings in the data and compute the frequency of each cycle of the acquired waveform. You can then compare the frequency of each cycle to determine when the signal changed frequencies.

The advantage of the first method is less software is required since the frequency measurement
is being done in hardware. You can also measure higher frequencies with greater resolution. Using an analog input task, you can only measure frequencies up to 2.5 MHz (following Nyquist)with a resolution of 1/5 MHz. With a counter and the analog trigger circuitry, you can measure 5 MHz signals (bandwidth limitation of the analog trigger circuit) with a resolution of 1/20 MHz. With the counter approach, you can also reduce the amount of data you need to transfer to your application by using the High Frequency with 2 Counters measurement method. This makes it easier to perform live processing of the data instead of storing the data to disk and post processing it.

The main advantage of the second approach is you're able to reach higher channel counts for less money. You'll have to examine the requirements of your application to see which methods makes the most sense for you.
0 Kudos
Message 5 of 5
(3,458 Views)