From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Frequency Counter Measurement Using 5661

Code and Documents

Attachment

Download All

This example shows how to use RFSA to perform frequency counter measurements. The measurements are highly dependent on the clock timebase. Since NI PXI-5661 is equipped with an OCXO, the readings have very low variance.

The example contains two tabs: One that acts like a spectrum analyzer and one that displays frequency measurements. You need to use first the spectrum tab (Figure 1) to find the highest peak you want to measure frequency from. Once the peak has been found, you can change the tab to visualize the frequency with great accuracy.

  1. Set the "Resource Name" (device name under DAQmx Devices)

  2. Make sure the source for the reference clock is set to "Onboard Clock" (or use an external reference if so desired)

  3. Set the "Reference Level (dBm)"

  4. Run the VI.

  5. Set your "Center Frequency"

  6. Set your "Span (Hz)"

  7. Set your "RBW (Hz)" (if you need more/less resolution to visualize your spectrum)

Figure 1. Spectrum Tab

8. Once you see a detected peak on the spectrum tab, switch to the "Frequency Counting" tab.

9. Set the "Integration Time (s)". See Figure 2.

Figure 2. Frequency Counting Tab

The graph shows how the measurement varies in time and gives the jitter (Hz rms) of the measurements.

John Passiak

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors