Hello.
Looking at your code, it seems to me that what you want to do is to process some number and to store it in a file each time you press a button in the front panel, correct?
I have attached a VI in LabVIEW 7.0 format, which has a case structure inside a while loop. The case structure has nothing in its false case, which means the VI will do nothing when the button in the front panel is not pressed.
When the user presses the button in the front panel, the VI reads the number from the numeric control, does the processing, and stores that number in the file. You have to make sure that the boolean button you use has its mechanical action set to "latch when ...". What that means is that after the VI does what its supposed to do after pressing the button, the button returns to its default value, so the VI only writes the data to the file once, and not every iteration of the loop.
Hope this helps,
Alejandro