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
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).
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.?
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.
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.