Hi,
I hope this short VBScript is the functionality you are looking for:
Option Explicit
' decalration
Dim iLoop, iLoopMax, iChnNo
' save original channel
call formulacalc("ch('X_Chn_Cop') := ch('X_Chn')")
' find line with first value = 0
call formulacalc("L1 := find('X_Chn_Cop' >= 0)")
'loop to set NOVALUES which not will be calculated
for iLoop = 1 to iLoopMax
chdX(iLoop, iChnNo) = Null
next
' get channel no for CHDX
iChnNo = cno("X_Chn_Cop")
' set loop end
iLoopMax = L1 - 1
' integrate
Call CHNINTEGRATE("X_Chn_Cop","Input channel for Y Values","Y_integral_1")
Best regards
Walter