05-23-2024 03:47 AM
Hello,
Is there a nice way to add an offset to certain values of a Channel?
for example add 360 to all values below 0, to have this curve run from 0 to 360?
Thanks
Regards G,
Solved! Go to Solution.
05-23-2024 05:30 AM
Found a nice solution myself,
Create a Channel with the same length and all 0 in
Compare if <0 with EventSearch and generate a channel with 360 if true
Add those two Channels
Call Data.Root.ActiveChannelGroup.Channels.Add("0",DataTypeChnFloat64)
Call Data.Root.ActiveChannelGroup.Channels("0").SetValues(0,1,2561,0)
ChnEventList1 = ChnEventCompareChnLT("", "[2]/Angle_Pred_zeroed [°]", "[2]/0")
Call ChnEventCreateStatusChn("/temp", ChnEventList1, "[2]/Angle_Pred_zeroed [°]", 0, 360)
Call ChnAdd(Data.Root.ActiveChannelGroup.Channels("Angle_Pred_zeroed [°]"),Data.Root.ActiveChannelGroup.Channels("temp"),Data.Root.ActiveChannelGroup.Channels("Angle_Pred_zeroed [°]"))