LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with measuring the frequency of a pulsing signal

Hi,

I am trying to use LabView to measure the flow from my ultrasonic flow meter. The meter sends a pulse for evey 10 litres of flow: I am picking up the signal in LabView without any trouble - it's basically a square wave that pulses at 10V and goes back down to 0V for the same duration.

All I need to do is measure the frequency or period of the wave, but I have had no luck with any of the vi's. They seem to focus on the wave when it's either at 10V or at 0V and return the period as infinite or 0.

I then attempted to program a sequence which returned true if the signal was =1 (the rising edge of the pulse), if true it would go to the next step, check again if =1 (falling edge), if true go to the third step and check if signal =1, and time that sequence, giving the period of the wave. Unfortunately this didn't work either.

Any suggestions?

Cheers,

Liam
0 Kudos
Message 1 of 7
(3,299 Views)

Hi Liam,

i think you can calculate the frequency with measuring the time differnce between to 10V points.

Mike

0 Kudos
Message 2 of 7
(3,296 Views)
hey mike,

thanks for your reply. yes you can get the frequency by taking the reciprocal of the period.

the question is How to get LabView to give me that period?! the two 10V points on the waveform would have to be one period apart from each other, and that's my unknown variable here/. (the 10V pulse isn't a short pulse, it's a held pulse giving a typical square wave). i think i need to somehow trigger the timer to start only when the signal is rising from 0V to 10V, then stop timing when the signal rises again, thereby getting one full period, but how to do this!

i can't understand why the pulse measurement vi won't work; i noticed some problems with older versions of LabView that discuss difficulties with low frequency signals -  maybe it's this?

cheers,

Liam
0 Kudos
Message 3 of 7
(3,282 Views)

Liam,

You need to count pulses over a known period of time.  This kind of measurement is best done with 2 counters.  One counter is set up to produce a precise timing signal that controls a second counter that is counting the rising edges of the incoming pulse train. 

There are several DAQmx examples that ship with NI the demonstrate this.

0 Kudos
Message 4 of 7
(3,278 Views)
Hi,

You can find the examples that centrebolt mentioned in LabVIEW by going to Help»Find Examples, then to Hardware Input and Output»DAQmx»Counter Measurements»Digital Frequency. The examples show high-frequency measurements as centrebolt explained as well as low-frequency measurements using only one counter.

Good luck with your application!
Tom

Applications Engineering, NI UK
0 Kudos
Message 5 of 7
(3,245 Views)
I have a similar problem with a proyect. Im measuring heart pulses. My input signal has a 2 V amplitude but since it is a heart beat the frequency can be lower that 1 Hz. I tried finding those eamples you mentioned "Hardware Input Output>>DAQmx" but there is no counter measurment, only Analog measurements. What can I do to view al examples? or is it no longer available?
0 Kudos
Message 6 of 7
(3,179 Views)
Hi, I have the same problem - my LabView edition is Student so I don't think I can access them.

Unfortunately the problem is still persisting. I have been working with someone who is quite experienced with LabView and he can't solve the problem either.

There was some progress when I used the Trigger and Elapsed time .vi's to measure the time between rising edge pusles. Since the pulses were quite slow, by putting the period-to-flow conversion equation in, the flow could seen reducing to a minimum value as the elaspsed time increased to the full period. I have fitted new, more accuarate flow meters into he pipes which now send 100 pulses for each litre of flow. These flowmeters now pulse so quickly that it's impossible to see what the minimum flow value is to get the flow.

If anyone knows of a way to select the maximum time value (i.e. the full length of the period of a square wave) that would be one solution to the problem. Any other suggestions on the best way to measure square waves would also be gratefully received.

Thanks in advance

Liam
0 Kudos
Message 7 of 7
(3,078 Views)