LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Calculate Duty Cycle

Hai All,

Im a fresher on LabVIEW, Im currently having a requirement which is to measure the duty cycle of a wave and to change an output voltage w r t that.. Changing the output volatge is not that much difficult for me, but Im unable to read the duty cycle continuously.. Can any one help me out for the same..

What Im trying to do is attached with this post... please verify if possible

Thanks for the same
0 Kudos
Message 1 of 4
(3,797 Views)
Hi there,
 
This is the LabWindows/CVI discussion forum. You might get more relevant response on the LabView forum http://forums.ni.com/ni/board?board.id=170 Smiley Wink
0 Kudos
Message 2 of 4
(3,794 Views)

While it's true that no much LV fellows are following this forum, I can tell you how I accomplished the same task in CVI: you should be able to easily adapt this concepts to LV.

Basically I used two counters to calculate the duty cycle, the first to calculate the period and the second to calculate pulse width lenght. Connect your signal to the gate of counter 0 and setup the acquisition for period measurement, next setup a pulse width acquisition on counter1, additionally setting it's input to counter0 gate. Start the two acquisitions and wait for completion: the duty cycle is pulse width / period measurement.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 4
(3,772 Views)

Hi Lab Test

I have tried what Roberto suggested and it works fine in LabVIEW.  I would suggest using the examples programs found at Help >> Find Examples titled: “Meas Pulse Width-Buffered-Cont.vi” and “Meas Buffered Semi-Period-Continuous.vi”   Just change the polymorphic instance of the DAQmx Create Channel VI from CI Semi Period to CI Period.

Once you have them acquiring pulse width and period data simultaneously, divide the pulse width by period, and then use that to output your voltage. 

For future LabVIEW questions please use the LabVIEW Forums located at http://forums.ni.com/ni/board?board.id=170

Chris_K

0 Kudos
Message 4 of 4
(3,736 Views)