DigitalFrequencyCounter.MeasureFrequency Method
- Updated2023-11-24
- 2 minute(s) read
DigitalFrequencyCounterMeasureFrequency Method
Measures the frequency on the specified pins over the measurement time. All pins in the pin list should have the same measurement time.
Namespace: NationalInstruments.ModularInstruments.NIDigital
Assembly: NationalInstruments.ModularInstruments.NIDigital.Fx40 (in NationalInstruments.ModularInstruments.NIDigital.Fx40.dll) Version: 2021
Syntax
public double[] MeasureFrequency()
Public Function MeasureFrequency As Double()
Return Value
Type: DoubleThe measurements taken, ordered according to the pinSetString parameter used when calling GetPinSet(String) to create the pin set. If a site is disabled, the method does not return data for that site. Use SortPinResultsBySite(NIDigital, String, Double, String, Int32) to order and combine the data to match the channel list. You can also use GetPinResultsPinInformation(String) to obtain a sorted list of returned sites and pins.
Exceptions
Exception | Condition |
---|---|
SelectorNameException | An instance of DigitalPinSet references a pin or pin group name not loaded in the pin map. |
IviCDriverException |
The selected function of one or more pins in the frequency measurement is not set to digital. Ensure that all pins have the selected function set to digital when you call MeasureFrequency.
- or - The frequency measurement contains pins configured with different measurement times. Ensure that all pins you want to measure in the call to MeasureFrequency have the same measurement time.- or - The input signal is invalid for one or more pins. To prevent an invalid signal error, increase the measurement time, ensure the input signal produces a sufficient number of edges within the measurement time, or ensure the input signal is within the measurable frequency range of the instrument.- or - The underlying NI-Digital driver returned an error. |
ObjectDisposedException | MeasureFrequency was accessed after the associated NIDigital or DigitalDriverUtility object was disposed. |
Remarks
The method returns site numbers in the same order as values read using BurstPattern(String, String, Boolean, TimeSpan),
GetSitePassFail(String), and Fetch(String, String, Int32, TimeSpan, UInt32).
Use this method to match values those methods return with site numbers.