From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Measure frequency of voltage signal

Good evening!

I am attempting to measure the frequency of voltage for a flowmeter using an NI 9205.  Knowing the frequency, I can then calculate the flow rate of the fluid.  However, I am having a hard time checking to see if my values that labview is reporting for the frequency is accurate.  I doubt the values because the frequency reported by labview is the same, regardless of flow (unless there is no flow, then the value is quite different).  However, I also doubt the flowmeter since it was purchased for under $10...I have a tone measurement vi to report the frequency.

 

One reason why the frequency may be wrong is the voltage isn't changing from 5, to 0.  It may go from 5.0, to 5.1, then 0.0, 0.1?  So is the tone measurement accounting for the period from 5.0-0.1?  Or from 5.0 to 5.1 etc.  Below is my block diagram.  We are doing continuous sampling at 2k Hz and n=500.  Any suggestions/comments are greatly appreciated! 

 

Thank you! 

0 Kudos
Message 1 of 5
(2,970 Views)

There's no point posting a picture of Express VIs since we can't see how they're configured.  Either convert it to real LabVIEW code or post the actual VI.

 

Can you verify with an oscilloscope that you have a valid signal coming from your sensor?  What kind is it?

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 2 of 5
(2,963 Views)

If your data file is not too large, please post that also so that we can see the actual data.

 

Lynn

0 Kudos
Message 3 of 5
(2,950 Views)

Thank you both for the quick responses!  It is a yf-s401 flow meter.  The profile of the voltage signal seems okay, what I am wondering about is if the frequency the tone measurement is reporting is accurate. 

 

Attached is the .vi and some data. 

It is a yf-s401 flow meter.

 

Thank you again for your time!

Download All
0 Kudos
Message 4 of 5
(2,899 Views)

Here is the way I would analyze your data. To simplify the example I placed a constant containing the numeric array from your data file on the block diagram. You could put a file read or the data acquisition VIs there.

 

After stripping out the header row and the column which has only 6 in it, the VI searches for rising edge transitions in the flow meter data and then converts that to frequencies.

 

It is so hard to tell what the Express VIs are doing because of their use of the Dynamic Data Type, that I almost never use them. This way I know exactly how I am processing the data.

 

Lynn

0 Kudos
Message 5 of 5
(2,885 Views)