LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

elapsed time after two pulse outputs

Solved!
Go to solution

I have a gas meter with a pulse output (or maybe more accurately, a contact closure) for every cubic foot put through the meter. The tricky part is that the closure length varies in duration as the flow of gas increases. 

 

I am sucessfully measuring the total gas volume used in a "run" by using a shift register to compare a change (either closed or open) and divide the total changes by two. However I'd like to record the elapsed time it takes for each cubic foot to pass through the meter and putput that to the screen. This number must only update when each cubic foot passes through the meter. This would be simple if there was just one pulse, or even two a set amout apart, but I'm having trouble with the irregularity.

 

It doesn't matter if the elapsed time timer starts on the rising edge or the falling edge as long as it starts and ends the same place and the reciprocal of that number is then displayed on the screen. 

 

My current control loop is a timed loop iterating at 250ms on a cRIO 9072. 

 

Any advice on how to implement/display this would be great!

0 Kudos
Message 1 of 2
(2,048 Views)
Solution
Accepted by topic author NXTenergy

Hi NXT,

 

detect rising edges of your counter. Store the current time in a shift register on rising edge and get difference to previous time:

Beispiel_VI_BD.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 2
(2,020 Views)