LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

event structure gets triggered twice

Solved!
Go to solution

crossrulz, thanks for your example, it's exactly the kind of behavior I wanted. I noticed that the "BS" button mechanical action is "switch until released", could you explain how your method can avoid the aditional event trigger? Thanks agan.

0 Kudos
Message 21 of 26
(1,277 Views)

@guangdew1 wrote:

could you explain how your method can avoid the aditional event trigger?


It isn't avoiding it!  It is USING it!  You will notice a case structure inside of the BS button's event case.  When the value changes to TRUE, we delete the last item and set the timeout.  When it changes to FALSE, we do nothing except set the timeout to -1 (wait forever).  Inside of the Timeout event case, we delete the last item when the BS button is TRUE.


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
Message 22 of 26
(1,271 Views)
Solution
Accepted by topic author guangdew1

@guangdew1 wrote:

crossrulz, thanks for your example, it's exactly the kind of behavior I wanted. I noticed that the "BS" button mechanical action is "switch until released", could you explain how your method can avoid the aditional event trigger? Thanks agan.


Note that you actually only need two event frames in total. Here's what I had in mind (sorry, I was on the bus earlier). This also ensures that the first "BS" triggers without delay.

 

You definitely need "switch until released". When you use "latch until released", it will read one more true state before it switches back to false when the value has been read.

Also note that the stop button should be latch action. Why did you change it?

Message 23 of 26
(1,267 Views)

altenbach and crossrulz, thank you both for the excelent solutions. I have always been thinking that LabVIEW can do almost whatever we want, you guys proved it's true.

0 Kudos
Message 24 of 26
(1,257 Views)

Let me correct that for you. 😄


@guangdew1 wrote:

LabVIEW can do almost whatever we want....


 

Message 25 of 26
(1,252 Views)

Thank you both again, your solutions are just excellent.

0 Kudos
Message 26 of 26
(1,245 Views)