To measure pulse width of a fixed-period signal, you only need to use one counter, so the configuration and program would be different than the frequency measurement example. Set the count source for counter 0 to "32kHz Reference" and the gate source (and wire your signal) to "Gate Input 0." You'll also need to create a control channel to reset counter 0 (as described in the frequency example).
Your LabVIEW program should run as follows:
- When Gate Input 0 becomes true, do nothing
- When Gate Input 0 becomes false again, read then reset counter 0
- repeat
You can use FP Advise to wait for the gate to change (just like the frequency example).
Once you have the number of counts, you can divide that by the frequency (32 kHz) to calculate the "on tim
e" (pulse width) of your signal.
Regards,
Michael Shasteen
Applications Engineering
National Instruments
www.ni.com/ask
1-866-ASK-MY-NI