02-19-2025 07:44 PM - edited 02-19-2025 08:32 PM
Hi everyone,
I’m having a minor issue with the **TDMS Set Scaling Information** function: I only want to create a single set of scaling information, but every time I write data, new scaling groups are generated. Is there a way to resolve this?
I also tried setting the scaling group number via the **input source**, but it didn’t work—additional scaling groups are still being written!
02-20-2025 05:35 AM
Hi Freddy,
@Freddy. wrote:
I’m having a minor issue with the **TDMS Set Scaling Information** function:
In my LV2019 installation I only find a polymorphic "TDMS Create Scale" function. Maybe you should also provide some code to your request?
Btw. that function does what its name says: it creates a scale…
02-20-2025 08:29 AM
I am guessing you have the scaling function in a loop. Set the scaling outside the loop, write data in the loop.
02-20-2025 07:43 PM
Yes, the function I am using is **TDMS Create Scaling**. However, my current requirement is that the scaling coefficients (conversion groups) may vary each time data is loaded. Every time I call this function, it generates a new set of conversion groups. Wouldn’t this result in an accumulation of more conversion groups as more data is loaded? I wonder if there is a way to either display only one conversion group or clear/empty the existing conversion groups?
02-20-2025 07:44 PM
Please see the attachment
02-20-2025 08:28 PM
@Freddy. wrote:
Yes, the function I am using is **TDMS Create Scaling**. However, my current requirement is that the scaling coefficients (conversion groups) may vary each time data is loaded.
Scaling is used for writing data to the file. It is not meant to be used for reading data. If you want to scale your data after you read it from the file, you can use math functions to do the scaling, this won't effect the data in the file.
02-20-2025 08:41 PM
Obviously, I’m trying to streamline my workflow. Since the number of channels and data length I’m currently storing in TDMS format are variable, post-reading processing would require significant additional effort. That’s why I want to use the built-in scaling group functionality. While it currently works fine except for displaying extra stored scaling group information, my goal is to retain only one scaling entry per channel group
02-20-2025 09:18 PM
One, you cannot erase properties in a TDMS channel.
Two - I am a bit confused as to what you are trying to accomplish. If I save data in a TDMS file with scaling information, then when I read it back the data is scaled according to the information I previously input. If I want to read the raw data I can set the Property NI_Number_of_Scales to 0 to get back the raw data. It seems you want to read the same channel, from the same file, and apply different scales to the data.
If different channels need to be scaled differently, then apply the scaling information only to those channels, not every one. To do that, you need to specify both the group and channel for the scaling information, not just the group. If you specify just the group, then all channels in the group get that information. From the example.
02-20-2025 09:26 PM
What I want to achieve is straightforward: I applied scaling group settings three times to the same channel group, but the conversion group information from each write operation keeps appearing redundantly. I only want to retain a single scaling group
02-20-2025 09:50 PM
As I said earlier, written properties cannot be erased.
I still do not understand why you want to scale the same data multiple ways, but if you want to that and not use elementary math functions and raw data then you could do the following:
In the example below, I changed the Y-Intercept to Pi instead of its original value for Channel 2. You would have to do the same for each polynomial coefficient.