LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS Read data type doesnt match data type at Write stage

Hey guys, I am fairly new to using the TDMS functions so bare with with me.

 

I am using TDMS Write to write arrays of Unsigned 16bit data to a TDMS file. For a process further down the line (and to appease a customer) I have a separate tool to convert those .TDMS files to .TXT files in manageable chunks. 

 

When I use the TDMS Read function the data coming out defaults to a double (64bit), not the 16bit data that was initially stored. This is inflating the file sizes, and forcing the data to be Read-In as a U16 array by connecting a U16 array to the "data type" actually *slows down* the loop execution speed.

 

For example.. Just using TDMS Read and leaving the "File Type" unconnected, the loop iteration speed is about 8ms, and all my U16 data ends up being saved as a double. If i force it to Read as U16 by using the "File Type" connection, labview executes 50% slower (12ms per loop) and the conversion process takes longer than the customer would like.

 

Furthermore, if you use the "Open & View" TMDS function and look at the data, it has a significant amount of trailing 0's and is clearly not U16. Does the TDMS Write function force all data to be represented as a double? Is there anyway to get around this?

 

My code is on another system, sorry I dont have any screenshots, I was hoping this was a TDMS function issue someone was familiar with.

 

Thanks,

0 Kudos
Message 1 of 4
(247 Views)

I am still having this issue, its odd. I am writing Unsigned 16bit data with TDMS write, and with TDMS read that data comes out as a double by default. If i wire the "data type" to a array of unsigned 16bits for the TDMS read it looks like the TDMS function still reads it in as a double first THEN converts it to a unsigned 16bit. I believe this is happening because... the TDMS viewer shows the data with a significant amount of trailing 0's, and if i set the TDMS read data type to a U16 it executes 50% slower then if I left it unwired and let it default to a double.

0 Kudos
Message 2 of 4
(177 Views)

Hi star,

 

you need to help us to be able to help you!

 

Why don't you attach a typical (but smaller) TDMS file, packed into a ZIP file?

Why don't you show the code where you write the TDMS file?

 

(When you use a recent LabVIEW version then please downconvert the VI to LV2021 or older. I prefer LV2019. File ->save for previous)

 

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 4
(164 Views)

First, show some code, 2021 or earlier.

 

Second are you sure you are saving as 16 bit? Look at the NI_Datatype property of the channel in the TDMS viewer. A datatype value of 10 is double, 6 is U16, and 2 is I16.

 

Third are you using any scaling properties with the channel? When using a TDMS scale, the data always looks like a double regardless of the underlying format.

0 Kudos
Message 4 of 4
(158 Views)