02-15-2019 07:57 AM
Hi guys,
I have a While loop with a long Wait (ms) time function. My Stop button takes too long to stop my loop. How can I program my Stop button to end a while loop immediately? I appreciate your efforts in answering my question.
Kindly check my Project as a snippet.
Solved! Go to Solution.
02-15-2019 08:02 AM
You need to divide your long waiting time into many small waiting intervals. Then in an additional while loop, wait either until your stop button is pressed or until all waiting intervals have been completed.
Regards,
Jens
02-15-2019 08:19 AM
@JensG69 wrote:
You need to divide your long waiting time into many small waiting intervals. Then in an additional while loop, wait either until your stop button is pressed or until all waiting intervals have been completed.
Regards,
Jens
Dear Jens, thanks a alot for your trial but how can i divide the long waiting time into small interval while it is entered by the user ?
02-15-2019 08:57 AM
Here's one idea that comes to my mind:
Regards, Jens
02-15-2019 11:14 AM - edited 02-15-2019 11:16 AM
A more scalable solution would be a better state machine where you would also add a wait state.
(Also make sure to use correct representations. DBL is incorrect for a wait)