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

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


Feedback


Yes No

Related Categories

Related Links - Developer Zone

DAQ-STC: Counting Cycles to Measure a High or Low Pulse Width (Easy-Level VIs)

2 ratings | 4.50 out of 5
Print

Downloads

Filename: 2072.zip
Requirements: View

This VI counts the number of cycles of an internal timebase to measure a high or low pulse width. This VI works with devices that have a DAQ-STC counter timer chip. Examples of these devices are the PXI-6070, PCI-MIO-16E-1, and AT-MIO-16E-2.

INSTRUCTIONS:
1. Enter the device number of your board.
2. Enter the counter number to use.
3. Choose the type of measurement.
4. Choose a timebase.
5. Run the VI.

KEY PARAMETERS:
This VI shows how to use the Easy level Measure Pulse Width or Period.vi to measure a pulse width. You can measure a single pulse or a pulse within a train of multiple pulses. Use the type of measurement input to choose which type of pulse you want to measure. The first two choices allow you to measure a single pulse, and the gate of the counter must start out in the opposite phase of the pulse you want to measure.. For example if you choose "measure low pulse width of a single pulse", the gate must start out high when you run the VI. Otherwise an error will occur. The last two menu choices are used when you want to measure a pulse within a pulse train. In these cases it is the previous gate transition which arms the counter to measure the next pulse. For example if you choose "measure one low pulse width of multiple pulses", the first low-to-high gate transition from one pulse would arm the counter to measure the next pulse.

The timebase you choose will determine how long a pulse you can measure with the 24-bit counter. For example the 100 kHz timebase will allow you to measure a pulse up to 2^24 x 10 microseconds = 167 seconds long. The 20 MHz timebase will allow you to measure a pulse up to 838 ms long. Since a faster timebase will yield a more accurate pulse width measurement, it is best to use the fastest timebase possible without the counter reaching terminal count (TC).

I/O CONNECTIONS:
Connect the TTL signal you want to measure to GATE pin of your chosen counter. To find the actual pin number, refer to the hardware user manual.

DAQ VIs USED:
Measure Pulse Width or Period.vi

Requirements


Filename: 2072.zip

Software Requirements


Application Software: LabVIEW Full Development System 5.0.1
Language(s): LabVIEW

Hardware Requirements


Hardware Group: Multifunction DAQ (MIO)
Driver: Traditional NI-DAQ (Legacy)

 
2 ratings | 4.50 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/).