01-30-2017 08:34 AM
I am using chnfind to find the first data point that is below a certain value, however there is some noise in the data, and so I need to be able to take two consecutive datapoints, average them, and repeat until the average is below 99. Attached is what the data looks like, and bleow is the current script I am using. I am new to vbs, but not coding.
Function startTime(syncGrp,syncChan)
Dim indxStart, aSymbol(1), aValues(1)
aSymbol(1) = "A"
Set aValues(1) = Data.GetChannel("[" & syncGrp & "]/[" & syncChan & "]")
indxStart = chnfind("A" & " > " & 100 ,,aSymbol, aValues)
startTime = indxStart * Data.Root.ChannelGroups(syncGrp).Channels(syncChan).Properties("wf_increment").Value
end Function
02-01-2017
09:48 AM
- last edited on
05-09-2025
11:53 AM
by
Content Cleaner
From this description, it sounds like you're trying to perform a moving average of the data. Have you tried any of the smoothing functions in DIAdem to accomplish this?