LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Disable dynamically control variables

Solved!
Go to solution

Hi,

 

I am using disabled and grayed in property nodes of controls in a case structure.

However, I have noticed variables can only be disabled or enabled when starting the application and not at run-time. I would like to disable controls after a variable change from False to True.at runtime. The behaviour of my VI is that it does not wait the variable change to disable my controls but that is not what I want to do.

 

Can you help me ? (I have Labview 64 bits 2020)

 

Regards,

 

Yohann

0 Kudos
Message 1 of 4
(267 Views)

I am unable to open your attachment.  However, all Controls and Indicators have a "disable" property that can be programmatically set (whereever you want set it) to either "Enabled", "Disabled", or "Disabled and greyed out".

 

On your Block Diagram, find the Control or Indicator whose Disable property you want to alter.  Right-click it, choose Create, Property Node, and choose the Disabled Property.  You will notice that it looks like a "Control" -- the "Disabled" wire comes out the right side, and if you create an Indicator there (the fastest way by right-clicking and choosing "Create Indicator"), you'll get an Indicator that will take on the value of the Disabled Property.  [You should probably rename this new Indicator].

 

But what if you want to set the Property?  Right-click on the Property Node, and choose "Change to Write".  Now you can right-click the input wire and choose "Create Constant".  Look what LabVIEW gives you -- a Constant that is a Enum with the three values this Property can take.

 

Bob Schor

Message 2 of 4
(235 Views)
Solution
Accepted by topic author amisi97

The problem is the terminal for your cmd button is before the While Loop.  So it is only read once when the VI starts.   Put it inside the while loop.

 

This is basic LabVIEW dataflow principles that are covered in the tutorials.

LabVIEW Introduction Course - Three Hours
Learn LabVIEW

0 Kudos
Message 3 of 4
(192 Views)

Thank you, it worked good. Yes, it was very basic. I wonder why I did not notice before !

 

 

0 Kudos
Message 4 of 4
(186 Views)