06-29-2009 02:37 PM
In my program, I have to inputs, both of which are booleans. I'll break down what I want to do in the simplest form to avoid confusion. When a user selects both of the inputs to be true, a counter begins and once the counter reaches a value, it needs to set both of those inputs back to false. Seems like it's so easy but I can't figure out how to do it. Thanks for any help.
Jeremy
06-29-2009 02:53 PM
Post what you have so far.
To require both inputs to be True, you will need a boolean AND function. If that is true then it increments your value by 1. If it is false, then it doesn't increment. Then if the value is greater than/equal to your target, then another case structure runs and inside of that it writes to a local variable of the two controls setting them to false. In the false case, it does nothing.
Of course you need to maintain the value of your counter between loop iterations, which means a shift register.
06-30-2009 05:43 AM
The attached does what you want. It'll be worth your time to learn how the JKI State Machine works. Once you learn it, you'll be able to write this program in <10 minutes. If you don't take the time, you may not be able to understand how it works and you certainly won't be able to pass off the work as your own. (Not that you'd ever do that.)