Hi,
Reviewing large quantities of CAN data performing some calculating to get some basic values, so to save time I have used the script record mode to produce a basic script, however I'm assuming as a result of how the CAN decoder works the groups don't always end up in the same order, so it is just stopping because there isn't a channel in that group with the correct name.
Is there a way of ignoring the group number and searching the entire data portal for the channel name?
Option Explicit 'Forces the explicit declaration of all the variables in a script.
Call Data.Root.ChannelGroups.Add("Power Calcs", 1).Activate()
Set ChnResult = ChnMul("/HVBusVoltage", "/TotalHVBatteryCurrent", "/Bus Power")
Set ChnResult = ChnUnitConvert("[1]/Bus Power", "/Bus Power", "kW")
Set ChnResult = ChnLinScale("[1]/Bus Power", "/Bus Power", -1, 0)
Call ChnClpCopy("[55]/Time", True)
Call ChnClpPaste(1295, True)
Call Data.Move(Data.Root.ChannelGroups(1).Channels("Time"),Data.Root.ChannelGroups(1).Channels,1)
Set ChnResult = ChnUnitConvert("[1]/Time", "/UnitConverted", "h")
Set ChnResult = ChnOffset("[1]/UnitConverted", "/UnitConverted", 0, "first value offset")
Data.Root.ChannelGroups(1).Channels("UnitConverted").Name = "Time(h)"