LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tone Measurements Output of 0

Solved!
Go to solution

Hello,

 

I'm trying to determine the frequency of an analog signal (tachometer pulse) so I can calculate the RPM and integrate it into a LabVIEW program. I've attempted to write a "dummy" program before I implement it into the full LabVIEW system at my place of work, but my dummy program won't work. 

 

First I tried to do it with the Measurement & Automation Explorer and used the "Tone Measurements" VI and it worked like a charm. However, when I tried to set it up without the MAX (i.e., task > sample clock > start measurements > read measurements > Tone Measurements VI), I get a frequency output of 0. Attached are my MAX file (tach that works.vi) that does work and my file that won't work (Tachometer File.vi).

 

I'm using a cDAQ-9174 and a NI 9203 as an analog input card.

 

If any of you could help, that'd be more than appreciated. Thank you!

 

 

Download All
0 Kudos
Message 1 of 13
(4,631 Views)

The evil Dynamic Data Type strikes again!

 

Tachometer File.vi has the Analog Read set to return one sample each time it is read. The Tone Measurements VI uses Fourier transform methods to find the frequency so it needs many data points, not one.

 

Try collecting enough samples to cover at least 3-5 cycles of the frequency you want to measure. Choose to have the data returned as a Waveform datatype. Then use the non-Express VI called Extract Single Tone Information.vi.

 

Lynn

Message 2 of 13
(4,570 Views)

Lynn,

 

Thanks for your reply. I changed my Read function to Multiple Samples, Waveform and also used Extract Single Tone Information.vi and now am returning a frequency value of Inf. Any idea on a fix?

 

Will

0 Kudos
Message 3 of 13
(4,542 Views)

If it helps, I opened up the Extract Single Tone Information while the program was running and there didn't seem to be an exported time signal. Could something be wrong with the time measurement and therefore the VI can't calculate a frequency?

0 Kudos
Message 4 of 13
(4,534 Views)

Many of the analysis routines are reentrant and will not display the data on the panel while running.  I do not recall whether this VI is one of those.

 

Returning Inf suggests that the data is not very well behaved. Try plotting the data you are feeding to Extract Single Tone Information.vi on a waveform graph. Do not use a chart. Select Make Current Value Default.  Save that VI and post it. Then we can see what your data looks like and how you have everything configured. Without being able to see the data we are mostly guessing.

 

Lynn

0 Kudos
Message 5 of 13
(4,522 Views)

 

Followed your instructions and here is my updated .vi. When using the Waveform Chart option the pulses showed fine but with a Waveform Graph they did not, maybe that's telling?

 

Thank you!

 

Will

0 Kudos
Message 6 of 13
(4,516 Views)

You are only getting a single data point.  It won't show up on a waveform graph because the point style is set to none, and you don't have more than 1 point to be able to show a line.  It will show up on a waveform chart because a chart buffers the data together.

 

Since it is only a point, you can't do any tone measurements on it like was stated earlier.

 

Try collecting N samples with your DAQmx read.

Message 7 of 13
(4,507 Views)

Thank you for your reply,

 

I originally had it on N samples for the Read function but it wasn't working then and I just tried it again and again nothing is happening. Single Tone Measurements is still returning INF for a frequency.

0 Kudos
Message 8 of 13
(4,500 Views)

And how big was the number of samples you wired in for that?  Are you now seeing a waveform in the waveform graph?

 

Try running it again, saving the waveform graph data as default, and posting that VI.

0 Kudos
Message 9 of 13
(4,495 Views)

Here you are. If by number of samples you wired in for that you mean in the DAQmx Task "Tachometer Task" I have it set to N Samples, 1k.

0 Kudos
Message 10 of 13
(4,492 Views)