Discussion:
how to make stop and start in one button
(too old to reply)
Mirage
2007-10-15 13:10:06 UTC
Permalink
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
altenbach
2007-10-15 13:40:11 UTC
Permalink
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. :)
altenbach
2007-10-15 14:10:10 UTC
Permalink
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! :)
 
There are many other possibilities. It really depends what else there is.Message Edited by altenbach on 10-15-2007 06:59 AM


StartStopMOD.vi:
http://forums.ni.com/attachments/ni/170/278165/1/StartStopMOD.vi
Mirage
2007-10-15 15:10:10 UTC
Permalink
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
Mirage
2007-10-15 17:10:05 UTC
Permalink
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

 
daquiry
2008-08-08 23:10:04 UTC
Permalink
a twist on this idea.  Is it possible to start the VI running other than using the run arrow?    I would like to have a big old button that says START to start execution, like a have a big button to STOP the execution.  Like Amadeus says "give 'em a big bang at the end to tell them is over",  I want to have a big bang at the beginning so they know how to start. Thanks.
altenbach
2008-08-09 00:10:05 UTC
Permalink
daquiry wrote:a twist on this idea.  Is it possible to start the VI running other than using the run arrow?  


Typically, you would set the VI to "run when openend" and enter a wait state (think state machine!) until the button is pressed to start whatever action is desired.
 
The run arrow is only for use during development anyway. The end user should not need to deal with it.
 
daquiry
2008-08-09 20:10:04 UTC
Permalink
wow, so beautifully simple.  Thank you altenbach

Continue reading on narkive:
Loading...