01-24-2013 07:26 AM
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?
01-24-2013 07:39 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
01-24-2013 11:13 AM
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?
01-24-2013 12:42 PM
@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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
01-24-2013 12:59 PM
Hooovahh,
Thanks for placing it on the Idea Exchange. I'm still hoping, however, there is already a way to do it.
01-24-2013 07:07 PM
Please see my comments in Idea Exchange. Thanks.
http://forums.ni.com/t5/LabVIEW-Idea-Exchange/TDMS-Read-EU-Raw/idc-p/2291800#M21278
07-11-2019 09:18 AM
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?
07-11-2019 12:09 PM
@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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord