niSync Measure Frequency (VI)

Installed With: NI-Sync

Returns the frequency of a signal at the specified terminal. The terminal you specify in source terminal must contain a digital signal for this VI to function.

Details

niSync Measure Frequency

cio.gif

instrument handle specifies the instrument handle that you obtain from niSync Initialize.

cstr.gif

source terminal specifies the source terminal of the signal to measure.

Valid values:

  • PXI_Trig<n>
  • PXI_Star<n>
  • PFI<n>
  • PFI_LVDS<n>
  • Oscillator
  • ClkIn
  • PXIe_DStarC<n>
  • PXIe_DStarB
cdbl.gif

duration specifies the length of time, in seconds, to measure the frequency. Set a longer duration to return a more accurate frequency measurement. The default value is 0.00000100 seconds.

cerrcodeclst.gif

error in (no error) describes error conditions that occur before this node runs. This input provides standard error in functionality.

cu32.gif

decimation count specifies by how much to decimate incoming trigger events. Use this value with a time-based device to adjust the number of timestamps that should elapse before the next timestamp is recorded. For example, if you set the decimation count to 10, the VI will record every tenth timestamp. The value must be greater than or equal to one, and the default value is one.

iio.gif

instrument handle out returns the instrument handle that you obtain from niSync Initialize.

idbl.gif

measured frequency returns the frequency, in Hz, measured at the specified source terminal. The measurable frequency range is dependent on your hardware; refer to your hardware's documentation to determine the frequency range of any given terminal.

idbl.gif

actual duration returns the actual amount of time, in seconds, that the VI took to measure the frequency of the signal at the specified terminal.

ierrcodeclst.gif

error out returns error conditions that occur after this node runs. This output provides standard error out functionality.

idbl.gif

frequency error returns the margin of error calculated for the frequency measurement. The formula used to calculate the error is:

error = [ (10M / base_freq) ] / [actual_duration]

where base_freq refers to the base frequency and actual_duration refers to the output of the actual duration terminal.

Details

Using Measure Frequency with Time-Based Devices

The following time-based timing and synchronization devices are compatible with Measure Frequency:

When using Measure Frequency with a PXI-6683(H) or other time-based device, timestamping is used to measure the frequency. The VI will measure timestamps until you have acquired timestamps that have an actual duration greater than or equal to the specified duration. If timestamps are not detected or not enough timestamps are detected due to a slow signal or a decimation count that is too high, the VI may encounter an error. Generally, you should have a timestamp within every second to avoid this error.

Note  The maximum signal you can measure using this VI is 22.7 MHz.

The decimation count terminal is only necessary on PXI-6683(H) and other time-based devices. In order to set the decimation count accurately, you should have a general idea of what range (Hz, kHz, MHz) the signal to be measured occupies.

Only PFI and PXI_Trig lines can be used as the source terminal on time-based devices.

For the most accurate measurement, the board clock for the time-based device you are trying to measure should be set to free running. If you are synchronizing to GPS, IRIG, or a PTP protocol like 1588, the VI may encounter an error or the result may be unreliable.

Troubleshooting the Software Buffer Overflow Error

When you are measuring frequency with this VI using a time-based device, you may encounter a software buffer overflow error. This means that LabVIEW does not have enough memory to store the recorded timestamps when measuring frequency. You can take one or more of the following actions to resolve a software buffer overflow error:

Using Measure Frequency with Signal-Based Devices

The following signal-based timing and synchronization devices are compatible with Measure Frequency:

Using a signal-based device and Measure Frequency, you can measure the frequency of the device's oscillator, an external clock connected to a front panel input, or a full speed or divided synchronization clock.

When measuring the frequency on a signal-based device, you must set the duration in multiples of 100 nanoseconds, i.e. a multiple of the PXI_Clk10 period. If the duration is not a multiple of the PXI_Clk10 period, it will be coerced to the closest multiple and returned in the actual duration terminal.