LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to reduce precision of TDMS file with express vi?

I notice that the express VI that saves binary data saves it with 8 byte precision. 

That ends up being about the same size as the text version. (My data is usually less than 2 bytes). 

 Is there an easy way to get the express VI to reduce its precision from 8 bytes to 2?

 

0 Kudos
Message 1 of 6
(3,105 Views)

First post some code, how you use the functions will determine how well a file is constructed, regardless of the format.

 

A TDMS file will log the data taking up the same amount of space that the data does in memory.  If you log two U64 numbers, the data portion of the TDMS file will take up 16 bytes ((64+64) / 😎  If you want to take up less space in memory, log with a less precise data type, of course you may loose some data in the process.

 

Basically what I'm saying is if you have a problem with the TDMS file size, it probably is in how you are using it.  Simply applying a defrag on your file at the end of a log will probably go a long way depending on the size and fragmentation.

0 Kudos
Message 2 of 6
(3,086 Views)

I wonder if compressing it would work.

 

0 Kudos
Message 3 of 6
(3,076 Views)

 

I am using a express VI to save a express data type. 

I tried to convert the data to an array but the express VI changed it back.

0 Kudos
Message 4 of 6
(3,070 Views)

@MikeBenson wrote:

I notice that the express VI that saves binary data saves it with 8 byte precision.


Are you referring to the Write Measurement FIle?  That uses the Dynamic Data Type, which can only really work with Double Precision Floating Points, 8 bytes.  If you use the actual TDMS API, you could cut that down.  For instance, I had a file in which we saved all data as DBLs for simplicity sake.  Then harddrive space became a factor.  So we saved in the TDMS the original data type (I32, I16, DBL).  That actually cut the file size by about 25%.

 

So this turns into the classic "Express VIs will get you started, but don't expect to go far with them".


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 6
(3,060 Views)

If compressing your file in a zip or any other archive does result in a significantly smaller file, then that is a sign that your TDMS is fragmented.  Best advice is to not use express VIs, and to do the work with the TDMS API yourself.  Avoid dynamic data types.  And Post your code, or a sample of it demonstrating what you are having issues with.

0 Kudos
Message 6 of 6
(3,051 Views)