Thank you. I dont see any logic for your timing to write to file, I do see the logic that triggers the boolean indicator when time increment is up. Do you plan to put your "Write to Measurement File" piece inside of a case structure? Just so we are clear, you want to take an average for each Temp (1-12) each iteration of your while loop? Let me know if we are on the same page.
Cheers