07-05-2012 10:50 AM
Hi All,
I have attached two simple VIs. Stop button can rebounce in second.vi but can't in first.vi.
I don't know why it can't rebounce in first.vi.
Could you help figure it out? Thanks, Guoguang
07-05-2012 11:04 AM
I am not familiar with the expression "rebounce".
Obviously, your VI makes little sense overall, but in the first VI you have a potential race condition where the upper loop will stop and reset the boolean before the lower loop has a chance to read the true state. THis will not always happen, but the probability is nonzero. If you press the stop the second time, the lower loop will also stop, but this time the button will no get reset because the local variable write has already happened.
In the second VI, the local variable will only get written once both loops have stopped.
What do you actually want to do? There are probably better ways to do this.
07-05-2012 11:38 AM
Hi,
Thank you for your reply.
Your answer is helpful.
I thought bottom loop will always run first.
I try to stop two why loops with one stop button.
Do you have better way to this?
Thanks again, Guoguang
07-05-2012 02:38 PM
It really depends on what else your loops are doing. For two completely independant loops, I'm partial to an Action Engine or a notifier.