From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controls are disable until certain control is true. How would you do this using event structure?

Solved!
Go to solution

Using LabView I created the attached .vi. What I am trying to do is that when I run the program I get 0 reading and speed 1 and 2 are disabled until I click switch to turn ON the voltage reading. If I don't switch to ON nothing will happen until I press switch. When switch is on, I can click either speed 1 or speed 2 while one of the other is off. How would I do this? 

0 Kudos
Message 1 of 8
(3,115 Views)

You can change the disabled property using property nodes as a function of program state.

 

I also would recommend to use "value change" event instead of "mouse up", eliminating these silly inner case structures.

0 Kudos
Message 2 of 8
(3,090 Views)

When you have events where you want to know if a button has been pressed, use Value Change to detect when the value of the button has been changed, not Mouse Up.  Then you can get rid of the "Button" node to know whether it was a left or right mouse click.

 

When you want to enable or disable controls, then use property nodes for those controls for with the "Disabled" property.  Set it to Write and right click on it to create a constant.  The you can set it for 1 of the 3 types, Enabled, Disabled, or Disabled and Grey.

0 Kudos
Message 3 of 8
(3,087 Views)

I tried and it's not working. Here is what I have. This is my first time using event structure. I am not sure how things work. 

0 Kudos
Message 4 of 8
(3,074 Views)

You fixed it to be Value Change.

 

But you didn't do anything with property nodes.

0 Kudos
Message 5 of 8
(3,061 Views)
Solution
Accepted by topic author BArtzon

Should speed 1 and speed 2 be independent or can only one (or none) be on at the same time? If so, use a radiobutton control.

 

In any case, here's a quick draft that might get you started.

0 Kudos
Message 6 of 8
(3,051 Views)

Excellent! Thank you very much! Now this makes a lot more sense. 

0 Kudos
Message 7 of 8
(3,045 Views)

Thanks!

0 Kudos
Message 8 of 8
(3,040 Views)