From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Append results of ChnPeakFind instead of overwriting existing channel

Hi,

I'm trying to use the ChnPeakFind() function in a script to loop through i = 1 to N channels and every ith channel append the location of the peak (result of ChnPeakFind) to the end of a result channel.  Anyone know how to do this?  My script just overwrites the value of the result channel each iteration of the loop...

0 Kudos
Message 1 of 3
(2,592 Views)

for x = 1 to 5
 set oMyChnx = Data.Root.ActiveChannelGroup.Channels(x)

  oMyChnx(chnlength(x)+1) = cch(x,2)
next

 

Regards

0 Kudos
Message 2 of 3
(2,544 Views)

Hi Traderhans,

Thank you for the response.  It appears the CCh() function returns the peak, but not the location (X Value) of the peak.  Still, good to know this function exists!

 

Thanks,

Chris

 

0 Kudos
Message 3 of 3
(2,536 Views)