10-22-2008 09:37 AM - edited 10-22-2008 09:39 AM
I am trying to make a script in Diadem 11 that takes the maximum value of the first 50 channels and puts these 50 values into a new channel.
I first tried the command ChnPeakFind, but it is creating too many new channels.
So I resorted to the ChnPropValGet(group/channel, "Maximum" ) command.
For I=1 to 50
MyChannel="[1]/" + I
CurrentMax = ChnPropValGet(MyChannel, "Maximum" )
Missing command here to append "CurrentMax" to a channel
'MsgBox(CurrentMax)
Next
I am running into two obstacles here:
1. The statement MyChannel="[1]/" + I doesn't work, because I doesn't flatten automatically
2. I can't figure out how to append the value to an existing channel
Normally the help files quickly get me going, but not this time.
I welcome your suggestions!
Thanks ahead,
Aart-Jan
Solved! Go to Solution.
10-22-2008 09:49 AM
Hello Aart-Jan!
Try this code:
Option Explicit Dim I Dim MyChannel Dim CurrentMax Dim nChnMax Call ChnAlloc("Max",50,1,DataTypeFloat64) nChnMax = CNo("Max") For I=1 to 50 MyChannel="[1]/[" & I & "]" Chd(i,nChnMax) = ChnPropValGet(MyChannel, "Maximum" ) Next Call ChnCharacter(nChnMax)
Matthias
Matthias Alleweldt Project Engineer / Projektingenieur | Twigeater? |
10-22-2008 11:10 AM
Tanks Matthias, you got me going again!