Example Code

Frequency Measurements and Triggering with DIAdem DAC

Code and Documents

Attachment

Overview

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.

 

Frequency_measurement.PNG

 

Description

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:

www.davisnet.com/product_documents/weather/manuals/07395-240_IM_06312.pdf
http://www.davisnet.com/product_documents/weather/manuals/07395-240_IM_06312.pdf

 

My example can also substitute the PFI functionality:

PFI Lines - NI Signal Generators Help - National Instruments
http://zone.ni.com/reference/en-XX/help/370524P-01/siggenhelp/integration_pfi_lines/

 

Eric H.
Applications Engineering
National Instruments

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

Comments
nepomnyi
Member
Member
on

Hi Eric,

thank you for the example. What do I do with your .DAC files? My LabView doesn't seem to read them.

Thanks.

Ivan

Contributors