Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Example Program
NI Supported: Yes
Publish Date: Sep 13, 2006

NI-DAQmx: Continuously Measure Counter Frequency (Buffered-Large Range)

0 ratings | 0.00 out of 5
Print

Downloads

Filename: daqmx_buffered_cont.vi
Requirements: View

I. Description:
This example demonstrates how to continuously measure buffered frequency using two counters on a Counter Input Channel. The Divisor, Maximum and Minimum Frequency Values, and the Edge Parameter are configurable.

This example shows how to measure frequency on the counter's default input terminal (refer to section IV, I/O Connections Overview, for more information), but could easily be expanded to measure frequency on any PFI, RTSI, or internal signal. Additionally, this example could be extended to measure frequency with other measurement methods for different frequency and quantization error requirements.

II. Instructions for Running:
1. Select the Physical Channel which corresponds to the counter you want to measure frequency on the DAQ device.
2. Enter the Measurement Divisor which specifies how many periods of the unknown signal are used to calculate the frequency. Additionally, you can change the input terminal where the frequency is measured using the channel property node.
Note: It is important to set the Maximum and Minimum Values of your unknown frequency as accurately as possible so the best internal timebase can be chosen to minimize measurement error. The default values specify a range that can be measured by the counter using the 20MHzTimebase. Use the Gen Dig Pulse Train-Continuous example to verify that you are measuring correctly on the DAQ device.

III. Block Diagram Steps:
1. Create a Counter Input channel for Frequency. The Edge parameter is used to determine if the counter will begin measuring on a rising or falling edge. The Divisor specifies how many periods of the unknown signal are used to calculate the frequency. The higher this is, the more accurate your measurement will be, but it will take the measurement longer. It is important to set the Maximum and Minimum Values of your unknown frequency as accurately as possible so the best internal timebase can be chosen to minimize measurement error. The default values specify a range that can be measured by the counter using the 20MHzTimebase
2. Call the DAQmx Timing VI (Implicit) to configure the Sample Mode and Samples per Channel. Note: For time measurements with counters, the implicit timing VI is used because the signal being measured itself determines the sample rate.
3. Call the Start VI to arm the counter and begin measuring.
4. For continuous measurements, the counter will continually read all available data until the Stop button is pressed on the front panel.
5. Call the Clear Task VI to clear the Task.
6. Use the popup dialog box to display an error if any.

IV. I/O Connections Overview:
The counter will measure frequency on the input terminal of the counter specified in the Physical Channel I/O control.

In this example the frequency will be measured on the default input terminal on ctr0.

For more information on the default counter input and output terminals for your device, open the NI-DAQmx Help, and refer to Counter Signal Connections found under the Device Considerations book in the table of contents.

Requirements


Filename: daqmx_buffered_cont.vi

Software Requirements


Application Software: LabVIEW Base Development System 7.0
Language(s): LabVIEW

Hardware Requirements


Hardware Group: Multifunction DAQ (MIO), Counter/Timers (TIO)
Driver: NI-DAQmx 7.5

 
0 ratings | 0.00 out of 5
Print

Reader Comments | Submit a comment »

 

Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).