09-18-2014 02:30 AM
I'm using the TDMS .Net dll version 13.0.40.242 to save my aquired data.
I dont create any new fields besides using the standard ones. But I can not access both Maximum and Minimum field that gets created by standard, and their not listed as proberties of the channel, subsequently both fields are empty.
My task is created with a range of -10 to +10 volt but this isn't used in the min/max fields either.
So, how can I use those fields? (or remove them to use my own)
09-19-2014 08:26 AM
As it is not listed under the automatic setted properties, you are free to change it.
http://digital.ni.com/public.nsf/allkb/B76C5ED987F464EC862579750059A761
You can change it with that function: http://digital.ni.com/public.nsf/allkb/E26C4B5AA4495463862579B9004FAE43
In C it would be TDMS_SetChannelProperty.
09-23-2014 01:35 AM
Yes, I tried that. But I could only change description, data type, unit but contrary to the linked page, Min and Max are not accessable via Channel proberties.
Keep in mind, I'm using the Measurement Studio on .net (c#), it differes in many points with the LabView equivalent. (less features and custimization options)
10-01-2014 02:32 PM - edited 10-01-2014 02:33 PM
Hi Treckl,
The reason you do not see the Minimum and Maximum properties is because you have not set them. When a new TDMS file is created using the Measurement Studio TDMS library, those fields are not created by default. You'll notice that if you save the contents of the DIAdem DataPortal into a TDMS file and open that with the Measurement Studio TDMS library, you will have access to the Minimum and Maximum properties because DIAdem writes them to the file by default. I have attached a DIAdem-saved TDMS file for you to use to verify this.
If you want to set the Minimum or Maximum properties, you can use the names, "minimum" and "maximum", as shown in the following snippet:
TdmsChannelCollection channelGroupChannels = channelGroup.GetChannels(); //channelGroup is TdmsChannelGroup created for the TDMS file. foreach (var c in channelGroupChannels) { TdmsProperty minProperty = new TdmsProperty("minimum", TdmsPropertyDataType.Double, -12.34); TdmsProperty maxProperty = new TdmsProperty("maximum", TdmsPropertyDataType.Double, 12.34);
TdmsPropertyCollection cp = c.GetProperties();
cp.Add(minProperty); cp.Add(maxProperty); }
Let me know if you have any questions.
Thanks,