LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

beginner's question

Could someone please give me some ideas on the following? How can I keep
track of the number of times a button is pushed, and then go do something
after the button has been pushed three times? Seems like there ought to be
a "event counter" tool, but I can't find one. Can the shift register
feature be used here? thanks, and remove the 'ABC' if you email me direct
(which is welcome).... David
0 Kudos
Message 1 of 4
(2,711 Views)
Yes a shift register would be a good way to go. Just use initialize one to zero, then use the increment function everytime the button is pressed. See the attached example.

Brian
0 Kudos
Message 2 of 4
(2,711 Views)
David,
There are a few ways, including use of counters and occurences.
Attached is a simple method using a shift register, compare logic, and a Case to open a dialog window (which you could change the insides as needed).
See if it gives you some ideas.
Good luck, Doug
0 Kudos
Message 3 of 4
(2,711 Views)
You've got it. Stick the button in a while loop with a shift register
initialised to 0, wire the button to a case structure and set the mechanical
action to "latch when released". Now the wire the shift register into the
case statement. Now you need to check the the shift register value is 2 or
less. Wire the output of the "<" to another case statement the true case is
where you put your action and zero the shift register, the false is where
you increment the shift register

Steve


Opportunity to learn from experienced developers / entrepeneurs (Fab,Joerg and Brian amongst them):
DSH Pragmatic Software Development Workshop


Random Ramblings Index
My Profile

0 Kudos
Message 4 of 4
(2,711 Views)