Take one step at a time.
To write data to a file every 5 minutes, it might be best to accumulate the data into an array. Use a while loop. Collect the data inside the loop and check if it is above threshold. If so, append it to the array. Inside the loop you can check the time. If 5 minutes have elapsed, exit the loop. After exiting loop, write to a file. A big loop must surround all this code to repeat it over and over. The big loop can create the file name. Use the i terminal, convert the number to a character, and conatenate the character to the basic file name, like "data" + "2" + ".xls". Try this on you own, post your code, and we can continue to help you with problems.
Here is a template to help you get started:
Message Edited by tbob on 11-10-2005 12:06 PM