Can someone recommend a method to calculate the max or min, at each point in time (row), from a list of channels? Right now I am looping through the channel length and using ValMax. Is there a fucntion similiar to ChnAverage but instead it calculates the max?
Option Explicit 'Forces the explicit declaration of all the variables in a script.
dim i, j
dim Length: Length = ChnLength(CNo("[2]/Pressure"))
dim Max, Min
Call ChnAlloc("Maximum",Length)
Call ChnAlloc("Minimum",Length)
For i = 1 to Length
Max = -100
Min = 100
For j = 2 to GroupCount
Max = ValMax(ChD(i,Ch("["&j&"]/Pressure")),Max)
Min = ValMin(ChD(i,Ch("["&j&"]/Pressure")),Min)
Next
Data.Root.ChannelGroups(1).Channels("Maximum").Values(i) = Max
Data.Root.ChannelGroups(1).Channels("Minimum").Values(i) = Min
Next
Call ChnCharacterAll