LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to count an event

hi all..

 

I'm new to Labview. I'm trying to figure out how to count the number of times a sine waveform reaches a certain amplitude value and displaying it on the front panel. Could somebody please guide me to do this.

0 Kudos
Message 1 of 5
(2,945 Views)

There is a VI in the Waveform palette called Basic Level Trigger Detection VI.  It finds the first instance where a waveform reaches that amplitude.  If you use that information in a loop and look at a subset of the waveform after that point in the next iteration.  Count up the number of times the loop runs until it can't find another trigger, then you will have the count you are looking for.

 

There may be other ways to do this, but this is the first one I came across that should do the job.

Message Edited by Ravens Fan on 01-12-2010 12:14 AM
0 Kudos
Message 2 of 5
(2,941 Views)

Hi thrix,

  Actually you can do this using event structures.I had attached a VI.

 

 

 

Thanks and regards,

srikrishnaNF

Regards,
Srikrishna


Message 3 of 5
(2,926 Views)

srikrishnaNF,

 

One problem with what you posted is that it counts all points that are above the threshold, not just the number of times the signal crosses the threshold.  I ran your VI as is and got a count of 49, though looking at the graph, I would say the answer is 3.  If the sine wave consisted of more data points, your count would have been even higher.

Message 4 of 5
(2,908 Views)
This one does what I think you want.
Tim
GHSP
Message 5 of 5
(2,902 Views)