Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading TDMS scaling values

Hello,

   I'm using Measurement Studio .Net in C# to save data from a NI USB-6210 to a TDMS format file. I am scaling the data with a LinearScale:

LinearScale scaleTest = new LinearScale("Test", 11, 2);
scaleTest.PreScaledUnits = ScalePreScaledUnits.Volts;
scaleTest.ScaledUnits = "N";

I set up a NationalInstruments.DAQmx.Task task and create a voltage channel:

task.AIChannels.CreateVoltageChannel(0,"TestChannel",AITerminalConfiguration.Rse, 0, 10, "Test");
task.Timing.ConfigureSampleClock("", 1000, SampleClockActiveEdge.Rising, SampleQuantityMode.ContinuousSamples);
task.ConfigureLogging("TestFile", TdmsLoggingOperation.OpenOrCreate, LoggingMode.LogAndRead, "Test");

all of which as far as I can tell works fine and I get the expected data in a TDMS file format which I can view in Diadem. The problem is that I can't find the values that have been used for scaling and offset in the metadata.

I'm looking at the Measurement Studio 2015 Support document (.chm format) and find on the page "Properties Autogenerated by the TDMS Library":

Scaling Properties

When you use NI-DAQmx to stream raw data and scaling information into TDMS files or the LabVIEW TDMS Create Scaling Information node to create customized scaling information, the following properties are created.

 

and then a list which includes the properties I am after, Linear_Slope and Linear_Y_Intercept. Does anyone know how I can retrieve this information from my file?

 

   Thanks,

          Tim

0 Kudos
Message 1 of 2
(3,065 Views)

Hey Tim,

 

Have you had a look at the "NI-DAQmx C Reference Help" support library?

http://zone.ni.com/reference/en-XX/help/370471AG-01/

 

I am not an expert in C, but I found these functions that might help:

 

(Linear_Slope)

http://zone.ni.com/reference/en-XX/help/370471Y-01/mxcprop/attr1227/

 

(Linear_Y_Intercept)

http://zone.ni.com/reference/en-XX/help/370471Y-01/mxcprop/attr1228/

 

Let me know if this helps!

0 Kudos
Message 2 of 2
(2,960 Views)