LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to count the number of cycles in sine wave

Hi,

I am new to Labview.  I have labview 8.2 version and my dataacquisition is NIDAQPAD6015.  I could write a program to generate a sine wave of desired frequency through simulate signal. My question is how do i measure the number of cycles for this sine wave as soon as I run the program. Hope my question  is clear.

Ravi Mokirala
0 Kudos
Message 1 of 15
(15,147 Views)
Find the midpoint of the peak to peak amplitude (usually 0).  Count how many times this midpoint is crossed in one direction.
To count, use a For loop with shift registers.  Convert waveform to a data array.  Wire in data array to For loop with indexing enabled.  Also wire to shift register.  Compare current data with previous data from shift register.  Look for midpoint crossing.  Example:  if midpoint is 0, look for when the data goes from negative to positive.
- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 15
(15,136 Views)
Do you mean using the 6015 or purely in LabVIEW? The 6015 has two counters if you want to count edges of an analog input.

Message Edited by Bill@NGC on 08-01-2007 10:26 PM

0 Kudos
Message 3 of 15
(15,123 Views)
Hi Bob,

 Thankyou for the reply. Can you just draw the block diagram so that I can understand it better.

Ravi Mokirala
0 Kudos
Message 4 of 15
(15,098 Views)

Here is a vi that will count cycles.  The last data point must end completely equal to or above the first data point or it won't be counted.  Incomplete cycles will not be counted.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 5 of 15
(15,083 Views)
Hi Bob,

Thank you for your response. As I am new to labview my questions may sound a bit crazy to you. How do I continuously increase the count of the cycles in sine wave i.e. I should get the cycle count as 1,2,3........50......100.... till I stop the test. The present  test shows a standard number i.e. 6 cycles. Your reply would be greatly appreciated. I am really sorry if I am troubling you a lot.

Thanks and  Regards

Ravi Mokirala

0 Kudos
Message 6 of 15
(15,045 Views)