LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS file and data access

Hi all!

 

I have received a TDMS file containing measured data. I can successfully access the data in the TDMS File Viewer block and see the data in graphs very nicely. But when I try to access the data by opening and reading the file I get the following error: 

 

Error -2525 occurred at TDMS Read in Untitled 1

Possible reason(s):

LabVIEW: (Hex 0xFFFFF623) TDMS file data could not be converted into the specified data type.

 

In the past I've accessed TDMS files this way but this file is somehow different (its not made by me). I've included my VI and the tdms file.

Download All
0 Kudos
Message 1 of 5
(2,160 Views)

I did find this post: 

https://forums.ni.com/t5/LabVIEW/LabVIEW-TDMS-file-data-could-not-be-converted-into-the-specified/td...

 

But with my knowledge I couldn't edit the loadAndFormatValues.vi to work with this file.

0 Kudos
Message 2 of 5
(2,159 Views)

I think the problem is that your Time channel is formatted as a Time, whilst the rest are all numeric arrays.

None of them are Waveforms, which is what you're trying to read.

 

You could do something like this:

cbutcher_0-1604654967915.png

 

And/or combine with TDMS List Contents to get a group of arrays (if they have the same length): Here I use Delete from Array to get rid of the Time channel from the string array.

cbutcher_1-1604655106130.png

 

 

cbutcher_2-1604655113251.png

 


GCentral
0 Kudos
Message 3 of 5
(2,148 Views)

Very cool and exactly what I wished to do!

 

Additional question though before I mark this as solved: how can I access the Time-format data then? I am trying to use Read function with the correct attributes but trying to use an indicator on the Time data returns an error. 

 

 

0 Kudos
Message 4 of 5
(2,115 Views)

The time channel is stored as an array of timestamps, so you can read it if you wire that to the datatype input on the bottom of TDMS Read.

readChannels.png

cbutcher_0-1604673414374.png

 

To create that, I put a Time Stamp Constant on the block diagram and used a right-click menu to convert to array. You could also have dropped an array constant (which would be empty) and then place a Time Stamp constant inside that.

The array for the other channels is either a 2D array of doubles when reading multiple channels (one row per channel) or a 1D array if you pass a scalar string to the Channel Name(s) input.

Remember that if you have different length channels, they will be zero-padded to the same length if you read a 2D array (because LabVIEW doesn't support "jagged" 2D arrays).

 

 


GCentral
0 Kudos
Message 5 of 5
(2,104 Views)