04-22-2014 08:59 AM
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 ?
04-22-2014 09:04 AM
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.
04-22-2014 09:12 AM - edited 04-22-2014 09:15 AM
you're almost there....you wanted to count the #s of "true".try using bool crossing and a SR
04-22-2014 09:32 AM
Ah, Apok understood your requirement a bit better I think.
04-22-2014 11:51 AM - edited 04-22-2014 11:53 AM
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.
04-22-2014 02:01 PM
Sorry for the picture. I'll try once again. I think the upper solutions work well. Thanks a lot for your respones.
04-22-2014 02:10 PM
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.