You can't stop a Wait (ms) while it is executing. Nevertheless, there are some options available for you to be able to stop a While Loop without waiting a very high amount of time.
When you use the Wait (ms) timing VI inside a While Loop, you allow the processor to execute other tasks in its queue, before coming back to check on your While Loop again. Therefore, it's always a good practice to keep your Wait (ms) numeric input in a low number. If you want your code to execute in a slower pace, and still be able to stop the cycle in a responsive way, try using the Elapsed Time Express VI, or create your own timer, as shown in the Community Example: FGV Timer.
The Elapsed Time Express VI indicates the amount of time that has elapsed since the specified start time. Use the Elapsed time (seconds) input to specify how much time must elapse before the Time has Elapsed Boolean is set to TRUE. (The default is 1.000). Review an example of code using this function here:
For better performance, consider using a Producer/Consumer architecture, QMH, or Dynamic Events. These architectures allow the processor to offload when the application is in Idle state, while using more efficient mechanisms to stop the execution when needed.
Collaborate with other users in our discussion forums
A valid service agreement may be required, and support options vary by country.
Thank you for your feedback.
You changed your response to Not Helpful
You changed your response to Helpful