LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ frequency measurement

Hello,
 
I'm trying to display a frequency number indicator from a low frequency analog voltage to my NI 6031E
the signal is a voltage wave ranging from 6V to 10V that has a frequency from 0 to 1.5 Hz
sampling is at 120Hz
 
I can only graph the input voltage signal in labview but connecting that  same orange line in labview to a tone measurement vi or doing a fft in parallel with an number indicator does not display a correct value for frequency.
Also, Labview says my DAQ hardware cannot measure frequency directly from my analog voltage signal (i.e AI Freq Voltage).
 
I also tried counter input. I'm not sure how to wire up the CTR0 gate in labview. I'm guessing it doesn't work because it's expecting a digital counter signal to CRT0 pin and not my actual analog signal. I thought i could just connect the same analog signal to the CTR0 gate but I tested it and it does see any count.
 
I'm new at using labview so any help is appreicated.  I attached a file that shows where I added a tone vi to take the frequency measurement.  But its not showing anything correctly. 
 
Thank you!






Message Edited by immortalc on 12-19-2007 01:55 PM
0 Kudos
Message 1 of 9
(7,861 Views)

You can't use the Tone Measurements function and expect accurate results if you acquire DBL data. The data has no timing information. When you convert to dynamic data, it's going to assume a dt of 1. Acquire a waveform data type instead if you want to use the analog in.

The counter input expects a TTL type signal.

0 Kudos
Message 2 of 9
(7,847 Views)
You may also want to have a look at the following KB. It includes an example on measuring the frequency of an analog input.

Making a Frequency Measurement with an Analog Input Channel
http://digital.ni.com/public.nsf/allkb/0A335655A8FF2C69862570BD0052DFDA?OpenDocument

There are also many resources online to help you learn LabVIEW. The link below would be a great start!

LabVIEW Introduction Course - Three Hours
http://zone.ni.com/devzone/cda/tut/p/id/5243
Regards,

Chris Delvizis
National Instruments
0 Kudos
Message 3 of 9
(7,823 Views)

Thanks for your help Chris.  I was looking for something like that.

I tried out the new sample program (analog in freq meas vi) from the first link you sent and that works great!

However, I copied most of the freq meas vi block into my orignal program and it seems like i can only display one measurement.  It's either my original graphs or that NEW frequency display but not updating together.  The frequency display works fine but the rest of my graphs and program is frozen.

Is there some way i make everything work together? i'm assuming LABVIEW cannot display 2 different kind of measurements on my front panel from the same ai12 physical channel? I noticed that the New freq display measurement is reading as a 1D waveform and my graphs must be 2D DBL.

Or is it something to do with sampling rate? I have my graphs on continuous sampling at 120Hz.  My freq display doesn't have to sample the same as long as its accurate.

 

Again, thank you for your help!

0 Kudos
Message 4 of 9
(7,768 Views)
You will only be able to have one analog input task running on your device at one time. However, after you have acquired this waveform you can take as many measurements from it as you would like. Do your original graphs work without the frequency measurement? You may want to start with the example that I posted before and build your other measurements on top of that. This way you can start with a working example and see where you errors are introduced as you add new items.

Also, the Tone Measurements VI will output only a single frequency value that you can view with a numeric indicator on the front panel. If you would like to view the graph of the frequency domain as in the example you will need to calculate the Power Spectrum using the Spectral Measurement VI and wire it to a Waveform Graph.
Regards,

Chris Delvizis
National Instruments
0 Kudos
Message 5 of 9
(7,752 Views)

thanks for your reply.  maybe i explained my situation incorrectly.

From the that sample freq program you showed me, i'm just using the numberic indicator for frequency only and not the other graphical displays (like the voltage and frequency spectrum).

In my original program, i already have a bunch of graphical displays measuring physical channel ai8 to ai12.

I wanted to see what frequency my ai12 channel as well as measure/display the voltage graphically.  I believe your saying that i can't measure both frequency and graphing at the same time on 1 channel?

What i did was I connect ai12 channel to ai13 and basically copied the the sample freq measure vi program to my original program to indicate frequency.

my orignal program has set the DAQmx reading ai8:ai12  to a analog 2D DBL multiple sampling.

but i noticed that the sample frequency measure program requires the DAXmx read.vi set to 1D waveform to measure frequency not 2D DBL like the rest of my program.  I think it is where this part i'm having problems with sampling all my inputs ai8 to ai13.

so when i copied the sample frequency measure program into my original program, it only runs one physical channel. Only the sample frequency program (ai13) or my other ai8 to ai12 graphs will work but not both at the same time.  It can't do all ai8:ai12 2D including the ai13 1D measurement continuously.

i dont think its possible to read in analog 1D and 2D measurements at the same time?

 

Thanks again.



Message Edited by immortalc on 01-04-2008 10:02 AM
0 Kudos
Message 6 of 9
(7,737 Views)
You seem to be having a problem understanding the basic LabVIEW data types. Retruning a 1D array of waveform datatypes is the same as returning a 2D array of DBL except the waveform datatype includes timing information. You can display the wavefrom graph and frequency at the same time and for multiple channels. Below is a modified shipping example that I hope will explain things a little better for you.
 


Message Edited by Dennis Knutson on 01-04-2008 10:16 AM
0 Kudos
Message 7 of 9
(7,725 Views)
Hi Dennis,
 
What changes do i have to make to measure the frequency if I MUST use an Analog 2D DBL instead of an Analog 1D Wfm like you have at the DAXmx read settings in your picture?
 
or maybe I'm looking for something to convert a 2D DBL to 1D signal so i can do the same thing as above.
 
Sorry about all these newbie questions. I took over someone else labview project and so its hard trying to incorporate more things to measure if i'm just learning it at the same time.  But thanks again!
 
0 Kudos
Message 8 of 9
(7,715 Views)

Why must you use 2D DBL? Can you explain in detail?

In any case, you can convert from a waveform to an array. A waveform datatype is a cluster that includes t0, dt, and a Y array. To get the Y array, you can use the Get Waveform Components function. This is on the waveform palette and works just like an unbundle by name. Once you've gotten more than a single 1D array from mulitple waveforms, you can create a 2D array with the Build Array function.

0 Kudos
Message 9 of 9
(7,707 Views)