07-12-2022 03:32 AM
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
Solved! Go to Solution.
07-18-2022 12:51 AM
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
07-18-2022 06:17 AM
many thanks, looks like I was just making a simple mistake of using round brackets instead of square!