Log in

View Full Version : Individual Button Presses


captainking
19-02-2011, 19:38
Hey, we are running a claw on the robot and want to make it so that pressing a button opens it, and then pressing it again closes it.

We have 2 limit switches to determine whether the claw is open or closed.

Our problem is that when we hold the button down, due to it being in a loop, it constantly switches between the "closing" state and the "opening state".

How can we make it so that LabVIEW reads each button press individually instead of checking it every loop iteration?

dahlboy15
19-02-2011, 19:52
If I were you (and this is what I did) I would simply program the the claw so that when you press and hold the button it is open and when you release it closes. It makes it much easier to program.

Mark McLeod
19-02-2011, 19:59
Depends on whether it's a motor or a solenoid.

Here's a single action (http://team358.org/files/programming/ControlSystem2009-/LabVIEW/ActionOnButtonPress.jpg) per button press.
Here's a generic button toggle (http://team358.org/files/programming/ControlSystem2009-/LabVIEW/ButtonToggle.jpg)

captainking
19-02-2011, 21:19
Mark, you have my undying gratitude, this has been a thorn in our side for a while now

MattCarey3625
20-02-2011, 07:33
We are using analog voltage to limit and to determine open and closed we are using case structures instead of while loops for the actual commands.