LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

boolean button rebounce

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

Download All
0 Kudos
Message 1 of 4
(2,699 Views)

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.

Message 2 of 4
(2,690 Views)

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

 

 

0 Kudos
Message 3 of 4
(2,677 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 4
(2,655 Views)