LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding No of Repetitions

Solved!
Go to solution

Consider an example, this pulse waveform contains some random repetitions of 0’s and 1's

 

 

wav.jpg

 

Here the occurrences of value 1 is 21 times. So, how I can count this programmatically as No of 1's as 21

If I use Search function of array, just it display the corresponding y axis value of the First occurrences of 1.

How can I perform this operation??? 

 

 

 

Regards

Gokul

 

 

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

Hi gokul,

 

just count the them:

check.png

 

If you want to count just rising edges: use a rising edge filter before (PtByPt-BooleanCrossing!)...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(2,686 Views)

Thanks for your kind reply GerdW.

 

when I follow your code. Just it gives no of repetitions of 1 on the basis of X - axis value. If my pulse is continuously giving 1 from ( 0 - 389 in X axis )

 

wavvv.jpg

 

It shows 389... But see above output picture there is no occurrence of 0 (from 0 to 389 in X axis ) right. so, my goal is to take that as one occurrence of value 1.. If my pulse again goes to higher state then count it as 2 till it falls to low state. 

Can you getting my point.??

Looking for your kind reply.!!

 

Regards 

Gokul

0 Kudos
Message 3 of 5
(2,677 Views)
Solution
Accepted by topic author gokul2013

Hi gokul,

 

did you read my comment on using a rising-edge filter in message #2?

 

Did you even try to use that? Did you try to configure the mentioned Vi to detect falling edges?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(2,670 Views)

Thank you GerdW..

 

Now I got the point. Thanks a lot.

0 Kudos
Message 5 of 5
(2,667 Views)