LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Switch when released

Hello,
i have a simple Vi where a Ok-button is connected to a bool-LED.
Both are in a while-loop.
The button is configured as "Switch when released".

When i run the vi and press the button then the LED is in the second loop TRUE.
But the button is still pressed and not released yet.

Or do i understand it wrong? My opinion is that the led has to go TRUE when i release
the button and not before.

Thanks for your help

Message Edited by NewOne on 10-24-2005 06:24 AM

0 Kudos
Message 1 of 9
(3,727 Views)

Hi

I could not look at you vi because I still use LV7.0.

I just made a vi as you described - it works without any problems and the indicator changes its state when I release the button.

Thomas

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 2 of 9
(3,717 Views)

Hello,

I think you have to configure the button as Latch when released. Then the Button will released automaticly..

Ciao TPoint.

0 Kudos
Message 3 of 9
(3,717 Views)

Sorry TPoint

NewOne is right. If he wants to change the state of the LED when he releases the button, he has to set the button to "Switch when released".

The difference between is that if you use "Switch when ..." the button keeps this state. If you select "Latch when ..." it is just a short impulse.

Thomas

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 4 of 9
(3,711 Views)
Okay, I understand:
 
The LED should be switched when released, but the button has to be latched when released....
I modified the code..
0 Kudos
Message 5 of 9
(3,707 Views)

I think now you're mixing up the things.

NewOne wanted the button to switch when released and obviously he wired the button directly to the LED.

There is nothing saying that he wants anything to be latched.

Thomas

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 6 of 9
(3,698 Views)
Sorry my fault. I just read the help and found:

"Changes the control value only after you release the mouse button during a mouse click within the graphical boundary of the control."

I first thought the control-button has to be released and not the mouse. But now its all clear.

Thx for your help.

0 Kudos
Message 7 of 9
(3,697 Views)

Hi,

The problem is not with your understanding, but with the while loop.

In this case (Switch when Released), the action is taken at the end of each iteration, but since the latch is not there, the button wouldn't come to its original position.

hope it explains.

 

0 Kudos
Message 8 of 9
(3,693 Views)

Thats what i thought first.
I thought "release" stands for "button goes in original position"

Now i know "release" stands for "stop pressing the mouse-button". If you hold the mouse button and the while-loop executes 100times but the LED goes TRUE when i stop pressing the button. So it works like explained in the help-file.


0 Kudos
Message 9 of 9
(3,679 Views)