09-21-2021 01:50 PM - edited 09-21-2021 01:55 PM
Thanks Brad I have two follow up questions:
1. When we load multiple files and calculate the peaks for each file how do we save the peaks generated to the same excel file using below method:
dd.DataFileSaveSel(PeakFilePath + ".xlsx", "ExcelTdmExport", PeakGroup.Channels)
2. Could you please suggest a method to calculate the average( arithmetic mean) of a single channels like Speed, Power separately and store it in a new channel respectively?
09-22-2021 01:32 PM
Hi josh,
I recommend that you create a result group with the channels/columns you want to export to Excel, then loop over all the data files you want to analyze, adding one or more row(s) from each data file to all the channels in the result group. After all the data files have been analyzed, you can then export all of the rows you've added from the channels/columns in the result group to the Excel file, using the DataFileSaveSel() command and the ResultGroup.Channels collection as the selected output parameter.
For calculating the average of a channel, I prefer the old CCh() function.
Brad Turpin
Principal Technical Support Engineer
NI