This widget could not be displayed.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Count a case stucture

Hello all,

how I try to count how many times a case stucture is entered. I have the case sturcture inside a while loop and I use an increment together with shift registers. But when the case stucture is entered the increment is exectuted with the while loop frequency. How I can count only once each time ? 

 

0 Kudos
Message 1 of 7
(2,750 Views)

Instead of using the loop increment, set the shift register to 0 (zero) outside the loop, then just put an increment (a "+1"),found in the numeric palette,  in the case that you want to count.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 2 of 7
(2,740 Views)

you're almost there....you wanted to count the #s of "true".try using bool crossing and a SR

true.png

 

0 Kudos
Message 3 of 7
(2,731 Views)

Ah, Apok understood your requirement a bit better I think.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 4 of 7
(2,712 Views)

Your picture doesn't show up in your original post.  It is just a box with a red X.  I don't know how you tried to insert it.  You need to sue the picture of the tree on the tool bar of the edit menu.

0 Kudos
Message 5 of 7
(2,676 Views)

Sorry for the picture. I'll try once again. I think the upper solutions work well. Thanks a lot for your respones.

0 Kudos
Message 6 of 7
(2,647 Views)

You need to wire through in the false case.

 

And like Putnam said, put a zero constant to the left hand shift register so it restarts at zero.

 

Put a stop control going into your while loop's stop terminal.  And put a wait statement in the loop so the loop isn't greedy.

0 Kudos
Message 7 of 7
(2,638 Views)