NI Home > Community > NI Discussion Forums

LabVIEW

Showing results for 
Search instead for 
Do you mean 
Reply
Member
Mirage
Posts: 4
0 Kudos

how to make stop and start in one button

Hello All

 

My Question is how to make button that when I prees it first time work as stop button and when I press it second time work as start button, I hope if I found my answer soon.

thank u all

 

Best Regards

Active Participant
Jorge_Amaral
Posts: 462
0 Kudos

Re: how to make stop and start in one button

Hello,

What's your labview version?
Software developer
www.mcm-electronics.com

PS: Don't forget to rate a good anwser ; )

Currently using Labview 2011
PORTUGAL
Knight of NI
altenbach
Posts: 27,594
0 Kudos

Re: how to make stop and start in one button

We would probably need a bit more info.
 
If you want a button that starts running the VI, that won't be easily possible, because the VI needs to be running in order to read the button state.
 
Typically, you would just set the mechanical action of your button to "switch action" and wire it to a case structure in a loop containing a small delay. Put the run code in one case and leave the other case empty. Now the switch will select which case executes for each iteration. Use different labels for the two button states (run|stop for example)
 
If your problem is more specific, please attach a simple version of your VI and explain how it should behave. :smileyhappy:

LabVIEW Champion . Do more with less code and in less time .

Active Participant
Jorge_Amaral
Posts: 462

Re: how to make stop and start in one button

I've made this quick example. But you can only see it if you've labview 8.5.
Software developer
www.mcm-electronics.com

PS: Don't forget to rate a good anwser ; )

Currently using Labview 2011
PORTUGAL
Knight of NI
altenbach
Posts: 27,594

Re: how to make stop and start in one button

[ Edited ]
It's probably not worth to add all these sequences, local variables, and parallel loops. Here's a somewhat simpler version, showing two possibilities: 0:using events, 1: not using events. Pick one! :smileyhappy:
 
There are many other possibilities. It really depends what else there is.

Message Edited by altenbach on 10-15-2007 06:59 AM


LabVIEW Champion . Do more with less code and in less time .

Active Participant
Jorge_Amaral
Posts: 462
0 Kudos

Re: how to make stop and start in one button

IOIOIOI


I'm a complicated person.

:smileyvery-happy:
Software developer
www.mcm-electronics.com

PS: Don't forget to rate a good anwser ; )

Currently using Labview 2011
PORTUGAL
Member
Mirage
Posts: 4
0 Kudos

Re: how to make stop and start in one button

Thank u all 4 ur help specially my brothers   "Jorge Amaral"  and  "altenbach"
and sorry to say that it dosn't work with me coze the version that I have is 8.2
 
Best Regards
Active Participant
Jorge_Amaral
Posts: 462
0 Kudos

Re: how to make stop and start in one button

That's why we always should mention our labview version when we post a question. In attach follows our friend version (it's simpler than mine)

:smileyvery-happy:


Software developer
www.mcm-electronics.com

PS: Don't forget to rate a good anwser ; )

Currently using Labview 2011
PORTUGAL
Knight of NI
altenbach
Posts: 27,594
0 Kudos

Re: how to make stop and start in one button



Mirage wrote:
Thank u all 4 ur help specially my brothers   "Jorge Amaral"  and  "altenbach"
and sorry to say that it dosn't work with me coze the version that I have is 8.2

My example was posted in LabVIEW 8.0, so you should have been able to open it easily. Check again.

LabVIEW Champion . Do more with less code and in less time .

Member
Mirage
Posts: 4
0 Kudos

Re: how to make stop and start in one button

Thankx so so so so so so so so so much

"Jorge Amaral"  and  "altenbach"

ur examples work 100 %

thankx again 4 ur help

Best Regards