08-19-2021 09:31 AM
Hi All,
I need help offsetting data but not the full range. I want to offset only the selected portion. Unfortunately, my data logger increased the timestamp by about 6.5 hours instantaneously. Can I write a script using ChnOffset to subtract the delayed time to bring it back in line with the previous data for the first instance of the shift as well as the remaining data in the file?
08-21-2021 05:56 PM
Hi af90,
If you want to subtract the same amount (say 6.5 hours) from all data points of your time channels, then the ChnLinScale() is the easiest function.
If instead you only want to subtract 6.5 hours from a part of your time channel, then you'd best create a new data channels with 0s everywhere else and 6.5 hours where you want the subtraction, then use ChnSub() to subtract the offset channel values from the time channel values... row by row.
Brad Turpin
Principal Technical Support Engineer
NI
08-27-2021 06:21 AM
Thank you Brad. This concept worked perfectly!