11-06-2020 03:03 AM
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.
11-06-2020 03:06 AM
I did find this post:
But with my knowledge I couldn't edit the loadAndFormatValues.vi to work with this file.
11-06-2020 03:32 AM
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:
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.
11-06-2020 06:38 AM
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.
11-06-2020 08:38 AM
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.
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).