LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to able or disable a string controll

Hello everyone, I wanted to know how I can do to enable or disable writing in a string controll with a boolean button.

0 Kudos
Message 1 of 5
(1,236 Views)

You can use a "disabled" property node for the string.

 

(We can give more specific advice once we see your code)

0 Kudos
Message 2 of 5
(1,215 Views)

@altenbach wrote:

You can use a "disabled" property node for the string.

 

(We can give more specific advice once we see your code)


A Select function will also be needed to chose to write the enabled property to "Enabled<0>" when the boolean is set to enable the string control and "Disabled<1>" or "Disabled and Greyed<2>" when the boolean is in the other state.


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 5
(1,212 Views)

Hi,

You find attached a VI that contains a solution for your problem.

Best Regards.

 

0 Kudos
Message 4 of 5
(1,179 Views)

@Emna20 wrote:

You find attached a VI that contains a solution for your problem.


Some quick comments:

 

  • If all cases of a case structure contain the same property node, that node belongs after the case structure. No need for al that code duplication.
  • As has been mentioned elsewhere, a select node would be cleaner unless the cases also contain additional code. It is easier to edit and debug code if we don't need to constantly flip through cases
  • It seems convoluted to use the event data node output if the control sits right there..
  • There needs to be a way to define the state when the program starts, i.e. before the user presses the enable/disable button. One possibility would be to add a timeout to the same event that zero once, then infinite. (see image)
  • "Disabled" and "Disabled and grayed out" are not the same and the OP needs to decide what's more appropriate. So far only "Disabled" was mentioned.

 

altenbach_1-1650209832960.png

 

 

0 Kudos
Message 5 of 5
(1,158 Views)