aceav8or Posted April 11, 2012 Share Posted April 11, 2012 Is there a way to log only the peak values of a channel over certain intervals, say 0-30 sec, 30-40 sec, 42-45 sec etc.. ? And if so is it possible to graph the trends in the different peak value intervals? If not, is it possible to integrate to find the area under the curve during different intervals? TIA! Link to comment Share on other sites More sharing options...
AzeoTech Posted April 11, 2012 Share Posted April 11, 2012 Sure, but do you want to do this after the fact? Or do you want peaks every 30 seconds of the last 30 seconds of data? Link to comment Share on other sites More sharing options...
aceav8or Posted April 12, 2012 Author Share Posted April 12, 2012 The signal runs for about 3 minutes. In that time there are 5 peaks of variable hight at roughly predetermined times +/- 20 seconds. I'd like to log the peak value over each 3 minute run and then update a trend graph on screen and log the data. Link to comment Share on other sites More sharing options...
AzeoTech Posted April 12, 2012 Share Posted April 12, 2012 Sure. First, you'll need 5 channels to hold the result. Let's say you call them peak1 through peak5. They'd all be device type "Test", "A to D", Timing = 0. Give each a unique Channel #. Next you'll need a variable to store the start time of the experiment. I'm assuming you have some script to start experiment, so just add this: global starttime = systime() Now you can write some script that runs after the 3 minutes are up that evaluates the data. It'd be something like this, assuming the channel you are evaluating is called simply "input": peak1.addvalue(max(input[starttime, starttime + 30])) peak2.addValue(max(input[starttime+30.00001, starttime + 40])) etc. for the other 3. That's actually it. The max value will go into the channel and the timestamp on the channel should be the timestamp of the max point. You can then plot these channels as you would any other. Link to comment Share on other sites More sharing options...
aceav8or Posted April 12, 2012 Author Share Posted April 12, 2012 Amazing! Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.