LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to really deactivate a button?

I am having a few buttons in my vi, that trigger different event case structures. due to the nature of the system events have to be done in a specific order - so I want to disable the buttons are not allowed to be used at the moment, because for example: it hasn't been enough data collected.
At the moment I am using the button property disabled. But the buttons are only grayed out, you are still able to push them. So it still triggers the event, which causes the vi to hang, because it's waiting for some data which it's not able to retrieve.
Is it possible to really disable buttons?
0 Kudos
Message 1 of 11
(3,912 Views)
What kind of event are you using for the disabled button? Mouse Down or Value Change? If Mouse Down, change it to Value Change.
0 Kudos
Message 2 of 11
(3,904 Views)

sthu,

I put a button on the front panel, set the Enabled State property to Disabled (or Disabled & grayed - either work fine) and put a Case Structure in the main loop to handle the button press.  The Case Structure does not fire because the button state cannot be changed from false to true.  If you are using an Event Structure in your loop to handle front panel events, you should look for the Value Change event.  If you hooked up a handler for the Mouse Down event, the event will still fire even though the button is disabled.

-cb

0 Kudos
Message 3 of 11
(3,901 Views)
What event are you waiting on?

I suspect 'Mouse Down'. Try using 'Value Change' and see if that helps...

Dennis is FAST. I'm only happy that my suggestion was the same as his. Smiley Very Happy


Message Edited by Phillip Brooks on 11-28-2007 01:14 PM
0 Kudos
Message 4 of 11
(3,900 Views)
The problem is that I just want to trigger the events when the button is pressed, but the button should return to its old state againg.
I hit the button - event is trigger - button returns to it's old position.
If I use the value change condition, the event triggers twice. one time when the button is hit and second time when the button is released. that would be a big problem...

0 Kudos
Message 5 of 11
(3,878 Views)
You could compare the New Value to True within the event case before executing your code, or you could experiment with the mechanical action (use Latch when released)


Message Edited by Phillip Brooks on 11-28-2007 02:22 PM
0 Kudos
Message 6 of 11
(3,871 Views)

It sounds like you are also using the wrong mechanical action for the button. Try Latch When Released.

p.s. Trying to guess what is in your VI is not always the most efficient way to troubleshoot. Posting the actual VI or an example that demonstrates the problem is the fastest way to see why something doesn't work and how it should be changed.

0 Kudos
Message 7 of 11
(3,870 Views)
 ok, thanks - I think I narrowed down the problem. The Buttons in my actual VI seem to be broken. No matter how I set their properties, the way how they react doesn't change... I'll try to replace them, though it will be a lot of work and see if it fixes it.
0 Kudos
Message 8 of 11
(3,858 Views)
Buttons don't get 'broken'. Why don't you just post the VI?
0 Kudos
Message 9 of 11
(3,853 Views)
guess what? I replaced one button and it works.. these are the days when I just start to dislike labview 😕
will be having fun deleting and creating buttons now...
0 Kudos
Message 10 of 11
(3,851 Views)