05-18-2016 12:03 PM
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.
05-18-2016 12:17 PM
@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.
05-18-2016 12:21 PM - edited 05-18-2016 12:36 PM
@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?
05-18-2016 12:40 PM
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.
05-18-2016 12:46 PM
05-18-2016 12:56 PM
Thank you both again, your solutions are just excellent.