Example Program Drafts

Showing results for 
Search instead for 
Did you mean: 

Frequency Measurements and Triggering with DIAdem DAC


This example can perform frequency measurements and triggering.

Counting pulses/edges per time with this example can be used to e.g. determine windspeed from an anemometer or as an alternative for PFI.





In the following, the block diagram of the variable sample time measurements is described.

  • A "virtual" analog signal is generated as a source.
  • As soon as a specified threshold is exceeded, a trigger is sent to a counter.
  • When a specified number of samples (default is 1) is exceeded, the time (sample time) is measured and the counter is reseted.
  • The sample time is converted to frequency.


Hardware and Software Requirements

DIAdem Base 2012 SP2 with DAC Kit (or compatible)


Steps to Implement or Execute Code

Decide wether a variable or a constant sample time better suits your application and download your chosen option:

  • Variable Frequency Measurement Triggering - DIA2012SP2.DAC
  • Constant Frequency Measurement Triggering - DIA2012SP2.DAC

I prefer the variable sample time, as this returns instant frequency measurements everytime a new pulse has been detected.

So now you are ready to grab some nasty measurements!


Additional Information or References

My example is also compatible to:



My example can also substitute the PFI functionality:

PFI Lines - NI Signal Generators Help - National Instruments


Eric H.
Applications Engineering
National Instruments