Something along the lines of this VI. I open the file you specify before the while loop starts and pass a reference into the loop. The file remains open until the while loop closes and I close the file. When you set the boolean to true, then I take the number from the measurement, convert to a string and add a line feed. That gets written to the file.
One issue with what I wrote is that the file gets created whether or not you ever make the boolean TRUE. If you want smarter code, then you need to open the file only the first time you try to write, then never again.
Your original VI would not look for the next point until the file write finished. So, you wouldn't drop any data that LabVIEW collected, but you were sampling at a slower rate.
You also should probaby add a time delay, as your CPU usage is probably very high. LabVIEW will execute the loop as fast as possible. With no delays built in, it may peg out your CPU.
Message Edited by Matthew Kelton on
02-20-2008 07:54 PM