XU,
It's confusing that you reused altenbach's example above--an example that was already sort of confusing because he had "fixed" it without changing the comments on the front panel to reflect his edits! You may be used to ignoring those comments in this case, but remember that other people will try to understand a VI using any comments that are visible.
The reason your example hangs is exactly what altenbach wrote a few messages above:
The main problem in your VI is the fact that your events are set to "lock front panel until event completes". In your case, you fire an event that is in a different case, the front panel locks up and you're stuck because the event cannot be serviced. It's out of the data flow! The quickest workaround would have been to just uncheck the "lock front panel..." option.
I've attached a screenshot that shows how to uncheck the "lock front panel until event completes" box for the case that handles your Start button. If you do this, the example might run more like what you expect, in that the user can click the STOP button at the bottom of the VI after it begins counting.
However, this is not really a complete fix for this example, because the VI will still hang if the user clicks the Cancel button (next to the Start button) after he clicks Start. Again, this is the expected LabVIEW behavior after you enable the Event case not to ignore panel events for the Start case, but it's probably not the behavior you want.
To fully resolve the problem, you would have to restructure the whole example. I would suggest taking the "counting" code completely out of the event case and putting it in a separate, parallel while loop. You would also have to introduce some sort of communication between the two loops in this case (local variables, queues, etc.), but this would be the general solution to allowing the counting to be interrupted "at random."
Regards,
John