06-03-2010 01:27 PM
Hi, i am newbie to labview and i want to simulate an universal counter in labview, so i have 2 generated waveforms(DBL) , one to comand the counter and one to be analysed. I have in my vi a selector for the gate time(wich i have conected to a Get waveform subset bloc ,one for each signal) and a selector for the function(freqvency, period or freq1/freq2) of the counter that i want to build.
How can i compare the 2 generated waveforms to get the period or freqvency of the analysed signal?
If anyone have an example or some advices pls reply(i am using labview 8.6)
Thanks
Solved! Go to Solution.
06-03-2010 01:53 PM
06-03-2010 03:01 PM
i didnt put the function selection yet because i dont know where to conect it yet.
thanks
06-03-2010 03:02 PM
You can get frequency from a waveform by using the Extract Single Tone Information.vi found in the palette Waveform - Analog Waveform - Measurements. Also found in Signal Processing - Wfm Measure. You will also find other functions here pertaining to waveforms such as Pulse Measurement and Amplitude & Level.
06-03-2010 03:29 PM
06-03-2010 03:38 PM
I don't understand the difference. Your vi outputs a waveform. The measure function performs FFT on the waveform to calculate the frequency. Please explain what you mean about "calculate the frequency like a real universal counter does." You want to measure the cycle time and calculate the frequency from that?
06-03-2010 04:16 PM
06-03-2010 04:49 PM
That is more clear. You want a pulse count. You have already captured the waveform. You need to count the number of rising edges. You will need to use Get Waveform Components and get the Y values in an array. Feed the array into a loop with indexing enabled. Count the number of times the voltage swings from the low threshold to the high threshold. To do this, you will need to store the previous value and compare it to the current value for each loop iteration. Or you can count the number of midpoint crossings in the positive direction to get the number of pulses. How good are you with Labview? Is this something you can handle or take a stab at? Try to learn by doing it yourself.
06-04-2010 12:27 PM
thanks tbob that is the solution but i am not so good with labview or what i am trying to do, so even u explayned what i have to do i didnt get it right:(
i got the Y component i conected it to a loop(for or while? that is placed in the ''big'' while loop)with auto-indexing enabled and to store the prev value i used shift registers. I compared the Y values but i didnt get any farther with the solution.
Pls help me finish this and thanks again.
06-04-2010 12:58 PM
I will come up with a solution, but it will be much later this afternoon if you can wait. Maybe someone else could fill in.