06-07-2011 11:05 PM
I am using Labview 2009 to control an x,y table which moves in a pattern a number of times as selected by the user. The pattern is selected in the case statement and the number of times the pattern is run is set in the For Loop by the value in "GRID" The value of "GRID" is 1-100. I understand that the "i" iteration count is zero for the first time the loop executes.
So the Boolean indicator is to show that the For Loop has executed the number of times as set by the value "GRID" I add 1 to i and compare to N which lights up the indicator when the Loop is finished the first time the program is executed, but when I run the program each subseqent time the Boolean indicator remains "ON" and has not reset.
Any thoughts about how to solve this?
Cheers,
Col
06-07-2011 11:54 PM - edited 06-07-2011 11:57 PM
Hi Niloc,
If you just want to reset the indicator you can wire a false boolen constant into the local variable of the indicator by keeping the boolean constand inside the for loop and local variable outside and disabling autoindexing.
Regards,
Nitzz
(Give Kudos to good Answers, Mark it as a Solution if your problem is Solved;))
06-08-2011 12:02 AM
Hi,
Take a look at the attached example.
Regards,
Nitzz
(Give Kudos to good Answers, Mark it as a Solution if your problem is Solved)
06-08-2011 04:08 PM
Why would you need to update the boolean with the same value N-1 times in a loop??? All you need is update it once before the loop and once more after the loop has completed, right?
(With a proper state machine architecture, most likely you don't even need a local variable.)