Is your stop button in the same loop as the subVI? If it is, then when you run the subVI, control is passed to that subVI and the stop button action will not be processed until the subVI exits and returns control to the main. One solution to that is to place the stop in a separate while loop that executes in parallel with the main while loop.