That's the expected behavior the way you've programmed it. A value outside of a while loop is read once and is not updated inside. If you're passing this value from a main VI, you've got an infinite as well as a subVI does not continuously get a new value from th main.