DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Copy part of channel into an array for calculating average

Solved!
Go to solution

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

Certified LabVIEW Architect
System Test Architect
Electrical Engineering
JLR
0 Kudos
Message 1 of 3
(1,771 Views)
Solution
Accepted by topic author RishiDivakar

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

Message 2 of 3
(1,723 Views)

Hi Walter,

 

Thanks. I have used this solution and it works fine.

Certified LabVIEW Architect
System Test Architect
Electrical Engineering
JLR
0 Kudos
Message 3 of 3
(1,705 Views)