DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

get max of every channel into a new channel

Solved!
Go to solution

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.  :smileysad:

I welcome your suggestions!

Thanks ahead,

 

Aart-Jan

Message Edited by aartjan on 10-22-2008 04:38 PM
Message Edited by aartjan on 10-22-2008 04:39 PM
0 Kudos
Message 1 of 3
(4,038 Views)
Solution
Accepted by topic author aartjan

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?  
Message 2 of 3
(4,033 Views)

Tanks Matthias, you got me going again!

Smiley Happy 

0 Kudos
Message 3 of 3
(4,030 Views)