07-01-2009 07:34 PM
Hi all,
I have a while loop and i need to count the number of times it execute. Is there a counter that is availabe to do this?
thanks
07-01-2009 09:30 PM
Yes, if you already have a while loop, then you already have the counter.
The blue 'i' in the bottom left corner is the iteration number.
Just right click on it, and select Create >> Indicator.
07-01-2009 10:53 PM
07-01-2009 11:07 PM
Write the iteration count to an unitialized shift register.
Have you tried any of the basic tutorials?
07-01-2009 11:12 PM - edited 07-01-2009 11:13 PM
When the loop stops, the indicator will show the final count. Just add 1 to it.
Or if you need to use that value later, wire it to the edge of the while loop.
Or do you mean that the while loop will be starting and stopping numerous times and you want the total iteration count?
07-06-2009 10:10 AM - edited 07-06-2009 10:11 AM
This?
Dennis' is good if you want to know your iteration in an addition series (0+1+2+3+4+5+...+n)
07-23-2009 07:32 PM
Hey all,
Sorry for not being clear enough previously. The main issue I have is that I stop a while loop when a certain condition happens and i need to get the iteration value when the loop stops or when the condition is satisfied. I have tried using the select from comparision palette, but the problem I am having there is that I have to give an input if the condition is false which I dont need. So, Is there a better way of doing this?
Thanks for the help:)
07-23-2009 09:06 PM
I would have thought that one of the examples given above would be the solution for you. But there must be something to your request that you aren't adequately describing.
Please post your VI so we can see what you are trying to do. Then we can come up with an answer for you.
07-23-2009 09:21 PM
07-24-2009 01:06 AM