LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

gray out switch

Solved!
Go to solution

Dear,

Does any know how to do it , when i use the switch the led should stay on and the switch should be grayed out

0 Kudos
Message 1 of 40
(4,349 Views)

That VI is simple..... TOO simple.

You require a loop in the code (don't forget a time delay!). And you have to learn about properties of controls.

Did you walk through the online training material for LV or attend a class at NI? If not, please do so!

 

thanks,
Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 40
(4,331 Views)

i know about the property nodes but but once someone hits the switch the switch should be grayed out and the led should stay on,

so i dont know why i should use a timed loop

0 Kudos
Message 3 of 40
(4,322 Views)

Hi drek,

 

but once someone hits the switch the switch should be grayed out and the led should stay on

IF button THEN
  GrayOut(button)
  LED:=TRUE
ENDIF

so i dont know why i should use a timed loop

No, you need to use a loop. The timing is just needed to not hog your CPU…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 40
(4,315 Views)

Next thing to consider:

If the button is grayed out, it cannot be used anymore by the user. You should add code to re-enable the button and another code to stop the VI.

DO NOT USE RUN CONTINUOUSLY!

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 40
(4,300 Views)

it is just what i wanna do, gray out the switch so the user cant use the switch no more until end of program

0 Kudos
Message 6 of 40
(4,294 Views)

Hi,

 

What is this application for? Good practice would be to use the Queue Handler project. It’s a steep learning curve but it’s well worth it. This way you can make use of the event handling loop to reframe from constantly polling and to easily implement your grey out. If you don't want to go down that path here is an image of a way to perform this task using a case structure and shift registers. I highly recommend you look into the examples.

0 Kudos
Message 7 of 40
(4,244 Views)

i know how to make the property node Disabled but not how to make the bleu Disabled and grayed out function

thx very much already

0 Kudos
Message 8 of 40
(4,224 Views)

Hi drek,

 

how do you create a constant in LabVIEW?

Usually you right-click an input and Create-> constant…

 

Pretty basic LabVIEW stuff: did you take the free beginner courses?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 40
(4,216 Views)

You mention enum constant i guess

0 Kudos
Message 10 of 40
(4,211 Views)