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: 

change push button to control or indicator in run time

Solved!
Go to solution

Hi,

 

I have a lamp which can turn on/off based on the value of a boolean variable.

 

 There are two modes in which I can control the lamp.

1) Manual mode in which the push button is to be used as a control to change the value of the boolean variable.

2)Auto mode in which the value of the variable is changed programmatically. Push button should turn to an indicator to show the value of the boolean variable.

 

I should be able to swith bw Manual and Auto mode during runtime and the push button should change to control and indicator respectively.

 

For those who might wonder why this is needed: there is a panel that has to be controlled in manual/auto mode. in manual mode, operator will manually use the buttons as controls to update control variables, in auto mode, my control algorithm will update the variables, and the operator has to be able to see which button is being pressed and when. so the button has to be the control for updating variables in manual mode, and has to be the indicator of changing variables in auto mode.

 

How can this be done? 

 

A basic VI with the three objects are attached, and the boolean control variable is global. 

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

Hello pcs82,

 

There is no way to turn a control into an indicator or vice-versa while the VI that contains it is running.

 

That being said, there are any number of ways to make a control "act like" an indicator.  What you need is:

 

1) A way to update the value from the block diagram.  Property nodes or Local Variables should probably be used here.

 

2) A way to prevent the user from entering new data when in "Auto" mode. This can be done by disabling the control via a property node or by rejecting changes to the control under certain conditions. If you want to reject user-entered changes, an event structure is probably the way to go.

 

You could also show or hide separate controls or indicators in the same location- using a button as an indicator and/or an LED as a button can be confusing and potentially very frustrating to the user.  Be sure to carefully select a look that conveys what you are trying to tell the user and document the control/indicator properly with tooltips and context help to explain how the object will work in different situations. 

 

Regards,

Tom L.
Message 2 of 5
(4,113 Views)
Solution
Accepted by topic author pcs82

Did this.

0 Kudos
Message 3 of 5
(4,055 Views)

OK, if you've fixed it, use the "solution" marker to indicate who you got the idea from, not you. You can fix this by editing from the "Options" box at the upper right of your post.

 

Cameron

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
0 Kudos
Message 4 of 5
(4,033 Views)

Hi Cameron,

 

I found that idea, no one else. so I ve marked it as a solution.

 

cheers!

0 Kudos
Message 5 of 5
(4,012 Views)