LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to reset button status

Hi, I have a program that I am working on with Labview 7.0.  I have a simple button in the program.  The problem is that if I turn off the program before turning the button 'off', the button stays on.  How do I make it so that the button will turn off if the stop button is pressed? 
0 Kudos
Message 1 of 6
(3,603 Views)

To change the value of a control in more than one place you would usually use a local variable (right click the control and select Create>>Local Variable. You can then write a value to that local and it will be written to the control. Note that a latched boolean control can not have locals, so you will need to change its mechanical action (right click the control).

To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here, here, here, here and here are a few you can start with and here are some tutorial videos. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).


___________________
Try to take over the world!
0 Kudos
Message 2 of 6
(3,595 Views)
It is a boolean switch, and I have mechanical action set to switch when pressed, which is what I want.  If I have it at latch when pressed, it does not stay latched in a while loop, which is what I need.  switch when pressed does the job, it just stays 'switched' even after the program ends. 
0 Kudos
Message 3 of 6
(3,591 Views)

@heepofajeep wrote:
If I have it at latch when pressed, it does not stay latched in a while loop, which is what I need.  switch when pressed does the job, it just stays 'switched' even after the program ends. 

Actually, "latched" means that the control is changed back to its previous value (think for example of the keys in your keyboard - you click one (change it to T) and as soon as you release it it jumps back to F. That's a "Latch when released" action.

In LV, the value is changed back after the terminal is read in the diagram.


___________________
Try to take over the world!
0 Kudos
Message 4 of 6
(3,584 Views)
   Thank you for the reply, but I already have a decent understanding of the mechanical actions.  My problem is that a boolean button that 'switches when pressed [mech. action]' does not UNSWITCH [go to F] when the program loop ENDS.  I am unsure how to make a button go to [F] from [T] when the VI stops. 
0 Kudos
Message 5 of 6
(3,576 Views)
As tst mentioned,
use a local variable of your button. Place a boolean constant "F" inside your while loop and wire it to the local variable outside the loop. Then the data will flow to the local variable after the termination of the loop. To make this behaviour clear, switch on the lightbulb (debugmode) and see what happens.
Hope this helped,
Dave

Greets, Dave
0 Kudos
Message 6 of 6
(3,572 Views)