LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Button value change registers in event structure but does not change appeaance?

Solved!
Go to solution

Hi everyone,

 

A quick question...Hopefully someone can provide an answer..

 

I have some code that uses a FP button within an event structure to trigger an AO signal... My code is below. The code works fine and the AO is triggered when the E-Stim button is pushed... But when pushed the button does not reliably change appearance (i.e. from grey "off" colour to red "on" colour)... Sometimes the colour changes; other times not... If I remove the event structure and poll the button the appearance changes as expected.

 

What is happening? I would like the button to change colours on the UI to indicate it is operating... Should I programmatically control the colour?

 

Regards,

Jack

E-Stim Button.png

0 Kudos
Message 1 of 7
(3,202 Views)

what is the mechanical action set for your button?

 

If you want to detect the change to ON to OFF and OFF to ON make it as switch when pressed.

0 Kudos
Message 2 of 7
(3,190 Views)
Latch when pressed... This is the action I want; so i toggles on-off when pressed...
0 Kudos
Message 3 of 7
(3,186 Views)

As latch when pressed locks the value only while pressing of the button, it will occur so fast that you will not be able to recognise it sometimes.

If you make it switch when pressed it will be shown as pressed only till you change its state again.. (as you said you want to update it on the UI.)

0 Kudos
Message 4 of 7
(3,182 Views)
If I use switched when pressed wont it say on and keep the on color state? Should I try switch until released?
0 Kudos
Message 5 of 7
(3,178 Views)
Solution
Accepted by topic author jcannon

I take it that when you poll the button you have some delay in your loop? Latching means that the button will change its value when you press it, then return to the original value once the control value has been used by the code. When you poll, that means until it reaches the next iteration in the loop, but in the event structure that will happen immediately.

 

The default setting for buttons to make it behave as in most application would be latch when released. You will then fire the event when you release the mouse button on the control. This also makes it possible to "slide off" the control if you pressed down on it by mistake, since you won't release on the control in that case.



CLA
www.dvel.se
Message 6 of 7
(3,173 Views)
Thanks LV_user1 and M_Peeker...

Latch until released = problem solved.

Regards,
Jack
0 Kudos
Message 7 of 7
(3,168 Views)