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: 

how to count total number of cycles of a waveform in labview

HELLO..

 

I am looking for a counter to count total number of cycles .

not like waveform peak detector. In waveform peak detector it will shows us the present graph cycles but not total number of cycles.

i mean if i run test cycles are starting from 1 it should continue untill i stop the test .

i want to know the total number of cycles from starting to end of the test.

 

0 Kudos
Message 1 of 12
(6,234 Views)
There is not nearly enough information here to give an exact answer. What is the signal? How fast is it changing?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 12
(6,230 Views)

simulated signal we can say.....

0 Kudos
Message 3 of 12
(6,224 Views)

What part of "simulated signal we can say" answers either of the two questions posed?

0 Kudos
Message 4 of 12
(6,210 Views)

check out this vi once.

 

in this vi i am getting only the current number of cycles.. but i want to have total number of cycles. if a new cycles has over then the cycle count increase by 1.This should happen untill i staop the test.

Kindly suggest me solution .

0 Kudos
Message 5 of 12
(6,208 Views)

The VI didn't attach.

 

What do you mean by "current" and "total"?  This might be more clear with the VI.  Is total something for a single run of the application or something that should last between runs?  

0 Kudos
Message 6 of 12
(6,203 Views)
0 Kudos
Message 7 of 12
(6,188 Views)

i am not able to attach my vi ..

 

could you plz help me

0 Kudos
Message 8 of 12
(6,183 Views)

save it as a VI instead of something randomly called cycle

 

The forums will block unexpected filetypes.

0 Kudos
Message 9 of 12
(6,155 Views)

Okay well the attached code was in 8.2 just no extension.  In any case I'd suggest you use one of the Waveform Measurements functions.  There is one to measure a pulse duration, and that will be the time it takes for one cycle of a wave to complete.  With the total time that the wave took place, you can divide and come up with the number of cycles in that time period.  

 

Or you can do it manually and maybe count the number of times the wave goes from below 5V to above 5V.  If you know your signal is a periodic and should be between 0 and 10 (for example) then knowing the number of crossings in the total time for the wave can also give you the number of cycles.

 

You are also probably going to want to be careful about a point being greater than the previous point.  If you have a real signal noise on the line may make you bounce back and forth rapidly at the peaks or valleys of your wave.  Which is why in my example I used 5V knowing it is at a point that we should have a steep increase.  But even here with a fast sampling rate may have additional edges.

 

EDIT:  Here is some quick code that seems to count the cycles.

 

Cycle.png

0 Kudos
Message 10 of 12
(6,110 Views)