LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

question about button implementation

Solved!
Go to solution

hi,

    I am a beginner in labview. I am now designing a program with play and stop button. When the play is pressed, the system begins and the play button becomes disabled .It turns enabled when the stop button is pressed. How can I realize it. It seems easy but hard for me. So discouraging.

 

thanks

 

jessie

0 Kudos
Message 1 of 9
(4,665 Views)
Solution
Accepted by topic author flysinger

Hi Jessie,

 

Use Event Structures to make user interactive vi.

 

Check out thise link.

 

http://zone.ni.com/devzone/cda/tut/p/id/3331

 

Rgds,

Venky

Message 2 of 9
(4,660 Views)
If you need your specific question answered and not a general design template, then you need to use property nodes. On the diagram, right click on a Boolean and select 'Create>Property Node. Browse the properties and select Disabled. Right click on teh property node and select Change to Write. You can now wire a constant to the property node. A value of 0 enables the control, 1 will disable it, and 2 will disable it and grey it out.
Message 3 of 9
(4,638 Views)

Hi,

     thanks for your information. I used an event structure. It seems that disabled and greyed button is not disabled. Attached the two picture of the event structure.It turns out that the tank's level can not be always changing after the play button is pressed. And more strange, if the play button is pressed even disabled and greyed, the tank's level can still be changed.

Download All
0 Kudos
Message 4 of 9
(4,624 Views)
You are not using the event structure correctly. First, you don't have a while loop around the event structure. Do NOT use the run continuous button. Second, you should really place the Booleans inside the event for them and I think you would be better off with a value change event. The while loop that runs only once does not make any sense to me. Do you want the Play button to start the tank simulation and keep that running until you press Stop?
Message 5 of 9
(4,614 Views)
hi,Dennis 
  I do want the Play button to start the tank simulation and keep that running until  I press Stop. Meanwhile ,there is a time indicator  that  run continuously no matter what happens to the buttons.
  I have taken your advice and change the event to value change. It works better.
  But the tank and indicator of time cannot work correctly.What does "Do NOT use the run continuous button" and "place the Booleans inside the event" mean?
   Attached are the whole back panel programm.  I really appreciate your help.
Download All
0 Kudos
Message 6 of 9
(4,607 Views)

hi,

     I found that I made a mistake. The stop condition of the while loop should be connected to true value. Attached are the corrected ones.

Download All
0 Kudos
Message 7 of 9
(4,597 Views)
Here's something a bit simpler. It uses a single Boolean ot enable/disable the tank simulation and does not require any property nodes.
Message 8 of 9
(4,590 Views)

hi, Dennis

     Thanks for your answer and the example. My programm has been changed and it can work now. I really learned a lot from this example. Labview is really a quite different language.

 

Regards

 

Jessie

0 Kudos
Message 9 of 9
(4,572 Views)