DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Data Channel Scaling in Diadem across multiple tdms files

Hello,

 

Can anyone help with the data channel scaling on Diadem across multiple tdms files? 

 

I understand how to scale and offset particular channel(s) in a tdms file by certain values. But if I want to execute the exact same action across multiple tdms files, how would I do that? 

 

To simplify my question, say I have 50 tdms files that recorded the oil temperature at some time intevals and I would like to scale that temperature channel by 3 and offset it by 1. After the channel gets scaled and offset, Diadem allows to either overwite the original data with the new offset and scaled values or to create a separate data channel. And I choose to create a separate data channel. After I have done what I wanted to do with the new channel whose values are scaled and offset from oil temperature channel, I loaded up the next tdms file on Diadem and would like to execute the same action (scale the oil temperature channel by 3 and offset it by 1). Instead of going through the same course of actions to scale and offset the oil temperature channel on following tdms files, how can I do it more efficiently so that I don't have to scale and offset the exact same channel 50 times for 50 different tdms files. 

 

Thank you very much in advance for reading this post and explaining, in advance.

 

Your time and effort are much appreciated.

 

Regards,

 

Steven

0 Kudos
Message 1 of 2
(4,293 Views)

Just use a little script like this one.

Option Explicit

dim srcFolder : srcFolder = "C:\temp\"
dim destFolder : destFolder = "C:\temp\dest\"

dim files : files = DirListGet(srcFolder, "*.tdms", "filename", "Filenames")
If IsArray(files) Then
  dim file : for each file in files
    
    data.Root.Clear
    call datafileload(srcFolder & file, "TDMS")
    
    ' do some stuff like scale
    Call ChnLinScale("[1]/[1]","[1]/scaledChannel",3.0,1.0)

    call datafileSave(destFolder & file, "TDMS")
  Next
end if
0 Kudos
Message 2 of 2
(4,265 Views)