06-23-2011 11:10 AM
Hello all, I have a small issue that I can't seem to get my head around. I have a boolean that is creating a count. I want to keep the value of the count if the program is stopped for any reason so I eliminated the constant outside the while loop wired to the shift register. I want to have a boolean that will reset the value of the count by the user. I have tried to do an event structure with a property node and zero wired to it, having the boolean creat a value change. This works in resetting it to zero, but when I start the count it goes back to the last value. I know it's something simple I'm missing. Thanks for help in advance.
06-23-2011 11:17 AM
You are only resetting the indicator, not the value in the shift register.
06-23-2011 11:24 AM
try this....
06-23-2011 11:36 AM
Outstanding, thank you, that was driving me nuts.
06-23-2011 11:59 AM
06-23-2011 12:03 PM
06-23-2011 12:05 PM
Yeah I did notice the difference, when I reworked mine I forgot to make current the default and it kept going to true and I couldn't figure out why. I'm learning. I will try with the event structure. Thanks again.
06-23-2011 12:29 PM
Did I do this correctly? It works but I feel like something isn't right
06-23-2011 12:48 PM
That looks pretty good.
I would move the terminal for count outside and after the event structure. Then you won't need the local variable of the count in the other cases.
I would eliminate the 100 msec wait in the while loop. The event structure will control the pacing of the loop.
I would disconnect the reset boolean and cycle switch buttons from the stop terminal of the loop. Though it should behave okay like you have it, there is no reason to connect it. Logically, hitting either of those buttons should have nothing to do with whether the loop continues or stops.
06-23-2011 12:54 PM