LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What VI can read raw data from a TDMS file with scaling information entered?

I would like to use scaling with my TDMS files so that the end user will
only see engineering unit values, however, within my Labview application, I
want to retrieve the raw data.  Is there a way to read the raw data using
one of the Vi's in Labview?

0 Kudos
Message 1 of 8
(3,243 Views)

The scaling information in a TDMS file is stored as properties of the channel.  One trick (that I haven't mastered yet) is you can change the properties of the TDMS file (set properties) and set all the scales to have a offset of 0 and a scale of 1.  This will apply a scale that has the engineering units be the same as the raw values.  Then you can read the data like normal and you'll get the raw values.

 

There are several issues to be aware of, the first is changing the scale and forgetting to change it back, or some how modifying the data to be incorrect units and not knowing it.  For this reason I'd recommend making a copy of the TDMS file to a temporary location to make the modifications to the properties, read it, then delete the temporary TDMS file when you are done.  

 

This is the only way I know of to get the raw readings from a scaled TDMS channel.  

0 Kudos
Message 2 of 8
(3,242 Views)

That does work and you can even set NI_Number_Of_Scales to 0 and not change the individual scaling factors in the file, however, once the file is written, I only want to open the file in read only mode.  I was hoping there was an advanced file VI that can read raw instead of scaled data without altering the file itself.  Are you certain this cannot be done?

0 Kudos
Message 3 of 8
(3,232 Views)

@KManSr wrote:

Are you certain this cannot be done?


No I am not, I'm only saying how I've done it in the past.  This sounds like a good item for the idea exchange so I made my first one here.

0 Kudos
Message 4 of 8
(3,225 Views)

Hooovahh,

 

Thanks for placing it on the Idea Exchange.  I'm still hoping, however, there is already a way to do it.

0 Kudos
Message 5 of 8
(3,218 Views)
0 Kudos
Message 6 of 8
(3,201 Views)

Are you saying it should be possible to create a general purpose utility that can clone a TDMS file, strip off all of the scaling and then have a version of the original with just raw data? 

0 Kudos
Message 7 of 8
(2,257 Views)

@viScience wrote:

Are you saying it should be possible to create a general purpose utility that can clone a TDMS file, strip off all of the scaling and then have a version of the original with just raw data? 


I believe that is what I was suggesting was possible 6 years ago.  Still since then I'd hoped that NI would have implemented something for this in the TDMS API, but nope.

0 Kudos
Message 8 of 8
(2,246 Views)