You should Never rely on the abort button on the tool bar to stop a VI in a loop writing to a file. The abort stops everything immediately and you don't properly close the file. Instead of using a boolean contant in your loop to get you an endless loop, add a Stop button (a boolean switch) to your front panel. Wire that through an inverter to the Continue terminal of the loop, or (if you're using LabView 6.x) right-click on the Continue terminal and change to Stop if True, then wire the Stop button directly to the terminal. Then pass the file RefNum out of the loop to the Close File function.
For debugging purposes, I do use the Abort toolbar button, but I never create a VI with the Abort as the only means of stopping a VI. Anytime you want to st
op a VI in a loop, you may want to have some control over how it stops. There may be files to close, instruments to shut down, results to process, etc. Even if the VI is very basic or even temporary, just get in the habit of using a Stop button on your front panel rather than a boolean constant to get an endless loop. It's really not that much more work and it gives you control over your VI.