LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to measure the time a pulse is high for?

I am using Pulse measure.vi to measure the output of a comparator. My comparator output feeds to an LED. The duty cycle is 50% so the LED just flashes on and off. I want to measure the time the output is high ('ON time') and I have been getting this by just multiplying the pulse width measure by the no. of pulses but I want to modify it to measure the 'ON time' of random signals with different duty cycles...

The aim is that I am taking in a signal and need the LED to turn on when the signal 'ON time' reaches a certain specified time.

But before I continue with the LED I am wondering how to add up the time the signal is high for?

 

 

0 Kudos
Message 1 of 3
(2,736 Views)

Doesn't Pulse Measurements.vi give the pulse duration out as a double? I think that VI already adds "up the time the signal is high for". Can you use that output of this VI to accomplish your task?

0 Kudos
Message 2 of 3
(2,691 Views)

Hi PinkLady4218,

 

You should be able to use one of the shipping examples to do what you need, please open LabVIEW and go to Help >> Find Examples.

 

From the Example Finder please go to Hardware Input and Output >> DAQmx >> Counter Measurements >> Period or Pulse Width >> Meas Buffered Semi-Period-Continuous.vi

 

You will then need to deinterleave the output array as it will show high time then low time then high time then ...

 

You will need to confirm the order these values appear and then you can use a function from the arrays palette and use the function "Decimate 1D Array"

 

Regards
JamesC
NIUK and Ireland

It only takes a second to rate an answer 🙂

0 Kudos
Message 3 of 3
(2,654 Views)