DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Using ChnOffset in Script to offset a select range of data

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?

 

af90_0-1629383458290.png

 

0 Kudos
Message 1 of 3
(1,112 Views)

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

0 Kudos
Message 2 of 3
(1,084 Views)

Thank you Brad. This concept worked perfectly!

0 Kudos
Message 3 of 3
(1,070 Views)