06-19-2012 10:26 AM
Has anybody got a good example VI for scaling TDMS files. I've capured data using the VI attached and I want to scale this data to a new file using scaling slope and intercept derived from a calibration VI. I thought this would be straight forward but when I followed the example NI provide it does not change anything but the scaling information writen to the TDMS file properties. The data remains the same.
Solved! Go to Solution.
06-20-2012 04:01 AM
You say the scaling information had written into the TDMS file properties but the data remains the same, I'm quite doubt about that. Could you please attach the tdms file here, I can verify whether the properties were written correctly or not.
Acutally, you can set the scaling info by calling "Create Scaling Information.vi" . I think the Linear Scaler is what you need. The Sample for Create Scaling Information can be found in the NI Example Finder.(Browse->Directory Structure:file->plat-tdms.llb->TDMS - Create Scalling Information.vi)
06-20-2012 12:35 PM
I've attached the signal conditioning VI that tries to scale the data from the 'Raw Data' group of the 'Raw Data' file to a 'Scaled Raw Data' group in a new 'Filtered Data' TDMS file. For some reason it saves a 'Raw Data' group in the new 'Filtered Data' file, that shows the new scale in the properties but the values have not been changed from the source 'Raw Data' file. I know that's a bit of a tongue twister, but I've attached the new 'Filtered Data' TDMS file that might illustrate what I'm talking about.
06-20-2012 10:02 PM
According to your excel file attached here, I am not sure the whether the scaler works or not. But I believe it works! You set slope = 0.033939 and intercept = -8.962304 on "Raw Data" group and the DATA on this group looks quite consistent with this SCALER.
This attached excel file has not a "Scaled Raw Data" group but a "Raw Data" group which is not consistent with your description.
Please attach the orignal TDMS file and a scaled TDMS file here, this may be more efficient to figure out the reason. (I can set slope = 1 and intercept = 0 to read out the raw data from the scaled tdms file.)
Here is allowed to attach both tdms and zip file.
06-21-2012 07:49 AM
You're right. The data is scaling, I think I must have a problem in the calibration VI. It's scaling but not doing it right therefore the slope and intercept is wrong. I don't know why it is not saving the data to a Scaled Raw Data group. I think I'll open a clean new post to deal with that issue.
Thanks for putting up with my ramblings, I appreciate your help.