01-30-2012 12:48 PM
Hi:
I’m trying to develop a script that searches a (non-perfect) sine wave between two given points and returns the maximum.
I have written code that will help me establish two points on the wave: one at the beginning of the peak and one at the end of the peak. I believe that using “StatBlockCalc” to return the maximum will work. However, each time I run the script, I get an error. I believe this is because I am doing something wrong to tell it which two rows to search between. Can anyone point me in the right direction?
Here is my code:
Dim Position_C1_0, Position_C1_1, Position_C1_0to1
Position_C1_0 = ChnFind("Ch(""[1]/[2]"")>10",0)
Position_C1_1 = ChnFind("Ch(""[1]/[2]"")<5",Position_C1_0)
Position_C1_0to1 = (Position_C1_1 - Position_C1_0) + 0
Call MsgBoxDisp("Positions: " & Position_C1_0 & " to " & Position_C1_1)
StatSel(5) = "Yes"
StatClipCopy = 0
StatClipValue = 0
StatFormat = ""
StatResChn = 1
StatResChnNames = 0
StatResChnNameFormat= "NameName"
Call StatBlockCalc("Channel",Position_C1_0-Position_C1_1,"[1]/[2]") '... StatDirec,RowNoStr,ChnNoStr
Dim Peak01_Ch02
Peak01_Ch02 = StatSel(5)
Call MsgBoxDisp("Max 01 = " & Peak01_Ch02)
Please note that “Peak Search” will not work for my application.
02-01-2012 10:25 AM
Hi Gatsby,
I was sitting at work today and I overheard my colleague mention that he was working on a similar issue and it just happened to be identical to yours. Since you have created a service request and a discussion forum post on the same issue, we will be continuing the conversation with you via one medium. I believe my colleague has already contacted you, as such please follow up with him. Have a great day.
Regards,
Perry S.