DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I Add all values in a specific row of a channel?

How can I Add all values in a specific row of a channel?
Is there a simple command to perform this task.
BBANACKI
0 Kudos
Message 1 of 4
(3,752 Views)

Hi BBANACKI,

sorry, I don't know what you mean, cause imo in a row of one channel is only ONE value.
To read (or write) a value from a row of a channel you can use:
ChD(x,y) or ChDx(x,y)

 

greets Andreas

Volkswagen AG
Wolfsburg - Germany
0 Kudos
Message 2 of 4
(3,739 Views)

Hallo bbanacki,

check out the function StatBlockCalc.

If you want to add all values of one channel:

Dim i
For i = 1 To 23
  StatSel(i) = "No"
Next
StatSel(2)       ="Yes"
StatClipCopy     =0
StatClipValue    =0
StatFormat       =""
StatResChn       =1
Call StatBlockCalc("Channel","1-","[1]/MyChannel") '... StatDirec,RowNoStr,ChnNoStr

The sum is both written into a new channel and witten into the custom property "ResultStatSum" of channel "MyChannel".

If you want to add line by line values of ten channels:

Call StatBlockCalc("Block","1-","'[1]/MyChannel1' - '[1]/MyChannel10'") '... StatDirec,RowNoStr,ChnNoStr

Christian

0 Kudos
Message 3 of 4
(3,731 Views)
Hello BBanacki,
 
In the DIAdem calculator, just enter this line and you can add any number to any "cell" in DIAdem:
 
ChD(x,y) = Ch(x,y) + z
 
example
 
ChD(1,2) = ChD(1,2) + 1
 
will add the value 1 to the first row in the second column of the data area in DIAdem.
 
This works both in the DIAdem Calculator and in DIAdem Script. This assumes that you use version 10.1 or later of DIAdem.
Otmar D. Foehner
0 Kudos
Message 4 of 4
(3,721 Views)