DAQ_Digital Frequency Measurement Library

DAQ_Digital Frequency Measurement Library VIs initialize, configure, measure, and close user-configurable PFI lines using selected counter for digital frequency measurement. This library is applicable for digital I/O channels and modules that support timing input signals with PFI channels or other connections. This measurement uses the large range (two-counter) measurement method. This method uses one counter to divide the frequency of the input signal by the specified divisor, creating a lower-frequency signal that is measured using second counter. Refer to the following topics for detailed information about this measurement method.

  • Large-Range Two Counters Measurement Method in the NI-DAQmx User Manual manual
  • Large Range of Frequencies with Two Counters in the TestScale Features manual
  1. Use the DAQ_Dig Freq Meas Initialize VI to initialize hardware and create a DAQmx Task for digital frequency measurement.
  2. Specify the physical or global channel input to use for the counter. Only one counter can be used for a task. Use separate tasks for each counter if multiple counters are required.
    Note Counter 0 is always paired with Counter 1. Counter 2 is always paired with Counter 3 for the large range (two counter) method used by this library. Paired counters cannot be used in other tasks.
  3. Provide the output terminal on which to measure the signal. Refer to the NI-DAQmx Device Terminals Help table. To access the table in NI MAX, select your device and right-click Device Pinout. Use the table to view the default PFI terminals of each counter for your device.
  4. If necessary, configure PFI lines.
    Note For the TestScale TS-15050 module only, P0.DIO<0:7> channels map to PFI<0:7> terminals. Refer to the TS-15050 Specifications for more information.
  5. Pass the digital frequency measurement DAQmx Task to the DAQ_Dig Freq Meas Configure and Measure VI.
  6. Configure the DAQ_Dig Freq Meas Configure and Measure VI.
    • Range—These settings include the frequency range for the measurement. Based on this setting, the internal time base is selected to obtain the highest resolution.
    • Measurement Settings—These settings include the divisor value for the large range (two counter) measurement method. The default value (4) is appropriate for most use cases. Update the divisor value only if necessary. Larger values increase measurement accuracy but a value that is too large causes the count register to roll over. Refer to Large-Range Two Counter Measurement Method in the NI-DAQmx User Manual for the frequency range calculation based on divisor value.
      Note For very low frequencies, the measurement may require multiple input cycles.
    • Output Data—Returns the detected frequency on the specified input terminal.
  7. Wire the updated digital frequency measurement task from DAQmx Task Out.
  8. Close the digital frequency measurement task with the DAQ_Dig Freq Meas Close VI.
Figure 34. Connection Block Diagram