Mizan Posted June 26, 2015 Share Posted June 26, 2015 Hi, I want to average some data for a calibration. I'm logging input1 and I want to find the average of input1 for 10 seconds so I can then subtract the average from input1 to log the variation about the average. I know how to log average of samples for a channel but that happens constantly. I want to press button which will then log the data for 10 seconds from that point and then find the average of that time period so I can assign it to a variable to use in equations. Thanks Link to comment Share on other sites More sharing options...
AzeoTech Posted June 26, 2015 Share Posted June 26, 2015 OK, create a sequence to do this: delay(10) global theAverage = mean(myChannel[systime(), systime()-10]) Then run the sequence from the button press by selecting a quick sequence action and putting: beginseq(mySequence) Replace theAverage, myChannel and mySequence with your own names. Note this assumes that you are continuously acquiring data on myChannel. Link to comment Share on other sites More sharing options...
Mizan Posted July 7, 2015 Author Share Posted July 7, 2015 Works perfectly. Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.