04-18-2016 05:03 PM
My main Program operation is to turn on a heater for a specified time (10 s), and put it off for 60 sec. Data between 30s-50s is averaged. This is repeated for a required number of cycles. The top loop tells the heater when to switch on and off ( not included completely), and tells the bottom loop when to start averaging. The bottom loop cannot have a outer while loop, and the random number function cannot be placed inside a new while loop. Currently I get a average of the data after all cycles. Would anyone be able to suggest me in a direction where I could get the average for each individual cycle.
Solved! Go to Solution.
04-18-2016 06:27 PM
1. You really should turn your top loop into a State Machine.
2. Your FGV would be more efficient as a Global Variable
3. You might want to have a look at the Mean PtByPt.vi for keeping your average.
4. You might also have a look at the Boolean Crossint PtByPt.vi for telling the Mean PtByPt.vi when to reset.
04-19-2016 02:11 PM
Thanks, using the PtByPt vi's hepled. However, I'm still off my average as the data when the boolean turns off is added as well. Is there any way I could exclude that data point? I have incuded getting the average by using shift registers and can be run for a single cycle for comparison.
04-19-2016 02:49 PM - edited 04-19-2016 02:49 PM
See if this helps some...