![]() |
|
|
I. Description:
This example illustrates how to continuously measure the duty cycle on a counter input channel. It requires LabVIEW 8.2 or newer as well as DAQmx.
II. Instructions for Running:
1. Select the Physical Channel which corresponds to the counter you want to measure pulse width on the DAQ device.
2. Enter the Maximum and Minimum Value to specify the range or your unknown pulse width.
III. Block Diagram Steps:
1. Create a Counter Input channel to Pulse Width. It is important to set the Maximum and Minimum Values of your unknown pulse width 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 pulses on the input terminal of the counter specified in the Physical Channel I/O control.
In this example the pulse width 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.
Great stuff. I added "LabVIEW" as a tag so it would show up on the front page.