And to answer your question about writing to the file, you need to provide a file name to avoid the dialog asking for one. Put a file path control on the front panel, put it outside the while loop, and wire it in to Write to Spreadsheet. You also need to set Append to File to true. The other way is to autoindex your measurements out through the while loop and save the data when you stop the while loop. This will actually be much more effecient as every time Write to Spreadsheet is called, it does an open and close file.