Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS 2.0: Minimum/Maximum fields?

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.

 

Untitled.pngSo, how can I use those fields? (or remove them to use my own)

0 Kudos
Message 1 of 4
(5,095 Views)

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.

 

0 Kudos
Message 2 of 4
(5,066 Views)

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)

0 Kudos
Message 3 of 4
(5,027 Views)

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,

Daniel Dorroh
National Instruments
0 Kudos
Message 4 of 4
(4,960 Views)