DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Editing individual channel points from a script

Solved!
Go to solution

Good morning. 

 

Is there a way to edit individual cell values within a channel but from a script? I know it's possible from the view tab in a table, editing an individual cell but I'd like to do it from a script to replace outliers with an average of the two points either side.

 

I've got a python script working which finds the outliers and returns their cell reference within the channel, and calculated the average of the two points either side, but I can't find a way of then replacing the required cell value.

 

Any help much appreciated.

 

Thanks

0 Kudos
Message 1 of 3
(900 Views)
Solution
Accepted by topic author DTS_PBO

Hi DTS_PBO,

 

If you have a channel variable you can simply use the index to change the value in the row of that index. Example:

 

oChn = dd.Data.Root.ChannelGroups(1).Channels("MyChannel")
oChn[3] = 100

We also ship two examples with similar content:

 

"Searching for Outliers with the ChnEvent Function"
"Searching for Outliers with the Peak Search Function"

 

Greetings

Walter

Message 2 of 3
(872 Views)

many thanks, looks like I was just making a simple mistake of using round brackets instead of square!

0 Kudos
Message 3 of 3
(859 Views)