LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a common RUN/STOP Button

Hi,

Does anyone has an example to make common START/STOP Button in main VI.

Thanks,

Kishor
kishorham@yahoo.com
0 Kudos
Message 1 of 9
(4,126 Views)
Here's one way.
Message 2 of 9
(4,126 Views)
it is a nice example. now my question is if i would like to run in the first frame and stop in 9th frame
of a sequence.how can i use this example there?i have
a total of 12 frames.i want to stop it in frame number 9 and do some other thing in frame number 9, 10, 11 and 12.
thanks
0 Kudos
Message 3 of 9
(4,126 Views)
Instead of using a sequence, try using a while-loop with a case inside and a shift register telling which case to do next...("state machine with feedback").

That way depending on what happens in one case (i.e. equivalent to sequence frame) you can change what happens next (e.g. stop instead of jumping to the next frame).
0 Kudos
Message 4 of 9
(4,126 Views)
i cannot change the sequence. because the rquirement
of my application is like this and i want to force to
each frame to run one after another.
with this sequence do have any ideas of one common stop/Run button.?

thanks
0 Kudos
Message 5 of 9
(4,126 Views)
A state machine does sequencing without any of the penalties/limitations of the sequence structure and a large number of benefits. A sequence cannot be stopped. It always executes every frame. You can kludge the code by putting case statements inside of each frame of the sequence but that, imho is a very inelegant way to program. Study the state machine architecture and you'll soom learn to love it and forget about ever using sequence structures again.
0 Kudos
Message 6 of 9
(4,126 Views)
I'm not sure what you are trying to achieve; do you want the start/stop button to pause the sequence and then commence where it was if start is pressed again?

Using the state machine you can still force the execution order but have more control; you can stop the sequence whenever you want, skip frames based on user input or other...and you can have a single start/stop button.

Attached is an example.
0 Kudos
Message 7 of 9
(4,126 Views)
Hi there,

I´m a beginner.

Can I apply a Run-Break-system with this or a
simialar method without stoping my Vi, just take a
break by a button?

Thanks a lot!!
0 Kudos
Message 8 of 9
(4,126 Views)
If by break, you mean to temporarily pause or put your program in some idle state, look at the example here.
0 Kudos
Message 9 of 9
(4,126 Views)