06-02-2021 11:00 AM
Hi All,
I have been able to plot channel values against a Time scale defined as TChannel. My requirement is to take a no of samples from the defined timestamp and to calculate the average of the samples. I have been able to do this manually by setting flags in band cursor. However, I need to automate this. Can anyone please suggest a solution for this?
I maybe able to copy the samples based on the channel index. But, I want the starting sample with respect to the timestamp I define in X axis.
Regards,
Rishi
Solved! Go to Solution.
06-04-2021 02:11 AM
Hi Rishi,
Please have a look at this example:
dim oChnT, oChnY, iStart, iStop
set oChnT = Data.Root.ChannelGroups(1).Channels("DateChn")
set oChnY = Data.Root.ChannelGroups(1).Channels("YChn")
iStart = pno(oChnT, TTR("01.05.2021"))
iStop = pno(oChnT, TTR("01.06.2021"))
call ChnStatisticsChannelCalc(oChnY, eStatsArithmeticMean, iStart, iStop, False, False, False, "NameName")
msgbox StatsResult(eStatsArithmeticMean)
Greetings
Walter
06-08-2021 04:36 AM
Hi Walter,
Thanks. I have used this solution and it works fine.