@Shijie wrote: Now I am wondering whether there are any ways to stop the loop right away after the Stop button is pressed.
You would need to add more smarts to your state machine by breaking up your loop into several states and/or repeat states. This way you are checking the button more often and can therefore break in the middle of the operation.
So the real lesson to be learned here is to not have "long" running states.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5