LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

button with two outputs

I cannot figure how to write a button that allows for one output when pressed and another when released
0 Kudos
Message 1 of 8
(3,321 Views)
All buttons by default have a true when active and false when inactive.

I am not sure what you are asking for so lets start with check the mechanical action (pop-up on the boolean and select Mechanical Action from the list). There are 6 different styles of action and maybe one of them is what you are looking for.

Hope that this helps,
Bob
0 Kudos
Message 2 of 8
(3,306 Views)
sorry, I mean that it has a off position then when presses it prodeces an output, then released it allows for a momentary output. I am creating a zoom in for a camera, once the command for the zoom in is activated it needs a stop command, percision is needed with the camera action so the stop command has to follow directly after the latch is rleased
0 Kudos
Message 3 of 8
(3,300 Views)
You want it to be active when it is pressed and go inactive when released? Or are you looking for the edges of when it is pressed and when it is released?

The first is easy. Set the mechanical action to Switch Until Released and put it in your loop. It will show false each iteration that it is not pressed.

The second is a bit more complicated. To trigger the edges, you can use an event structure with the event set to value change. Or you can keep track of state in your loop and set a trigger when the new state != the old state. This is done with a shift register and load the right side with the present value of the button and compare the left with the button.

I hope that this helps,
Bob
0 Kudos
Message 4 of 8
(3,280 Views)
I'm not too sure either what you're trying to do, but if the mechanical actions don't help you, you may want to have a look at the event structure. You can register a mouse up or value change event for that button and the code in that frame will execute when the event is fired (assuming the program is waiting there, of course, and not doing anything else at the same time).

___________________
Try to take over the world!
0 Kudos
Message 5 of 8
(3,279 Views)
Thanks Bob, that sounds good
0 Kudos
Message 6 of 8
(3,276 Views)
0 Kudos
Message 7 of 8
(3,274 Views)
This is a duplicate thread: The solution as been posted over here.
0 Kudos
Message 8 of 8
(3,259 Views)