03-13-2014 10:02 AM
Try this, is still a loop, but build in Functions work better.
Dim
counter, Chlen,Chn_time,Chn_time_cut, Grp1,j
ChLen =
Data.Root.ChannelGroups("data").Channels("time").Properties("length").Value
Chn_time =
Data.Root.ChannelGroups("data").Channels("time").Properties("numBer").ValueCallChnAlloc("t_cut", ChLen,1,,,1)
Chn_time_cut =
Data.Root.ChannelGroups("data").Channels("t_cut").?Properties("number").Value
counter=
For j = 2to ChLen Step n 'loop over cells of channel
counter=counter+1
CallDataBlInsertVal(Chn_time_cut,counter,1,CHD(j,Chn_time) ,False)
Next
03-13-2014 10:35 AM
Thank you! You are truly helping me now 🙂
This is faster clearly.
The version of the code is:
Dim counter, Chlen,Chn_time,Chn_time_cut,j,n
ChLen =Data.Root.ChannelGroups("data").Channels("time").Properties("length").Value
Chn_time =Data.Root.ChannelGroups("data").Channels("time").Properties("number").Value
Call ChnAlloc("t_cut", ChLen,1,,,1)
Call interactionon
Chn_time_cut =Data.Root.ChannelGroups("data").Channels("t_cut").Properties("number").Value
counter=0
n=10
For j = 2 to ChLen Step n 'loop over cells of channel
counter=counter+1
Call DataBlInsertVal(Chn_time_cut,counter,1,CHD(j,Chn_time) ,False)
Next
Louval
03-13-2014 03:03 PM
Hi louval,
It sounds like you should check out a couple of ANALYSIS functions:
Curve Fitting >> Linear Mapping
Statistics >> Reducing Classification
For the Linear Mapping you will also need to create the desired time channel that has Time_orig/N values.
Brad Turpin
DIAdem Product Support Engineer
National Instruments