LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Recovering from TDMS Error -2503 - Deleting index file doesn't fix

Solved!
Go to solution

My team has been running some data acquisition on some test machines, and I went today to start analyzing the data.  It turns out that two of the TDMS files that we generated could not be opened in Diadem, Excel, or using the Opend TDMS File commands in LabVIEW.  I also tried the TDMS repair tool, with the same result.  The test machine have since been torn down, so there is no way to re-run the tests.  Is it possible to have the files looked at to see if any data can be recovered?

 

Files were generated with LabVIEW 2013 SP1.  Attemtped to open them in the same version of LabVIEW, as well as Diadem 2015, and the excel importer (excel 2010).

 

The TDMS files are rather large (>1GB), but the tdms_index files that were generated with them were 0kB.  Deleting the tdms_index files and re-opening the TDMS files had no effect.

 

An initial look into the files (using the open binary file primitives in LabVIEW), the initial section of the files look correct (readable metadata that matches from a working file to a non-working file).

 

There seems to be no noticable connection between the two files that cannot be opened, nor differences in situation from those files to the working files.

 

Any help would be greaty appreciated.

0 Kudos
Message 1 of 3
(3,583 Views)
Solution
Accepted by topic author MikeC3

TDMS files are written in chuncks.  At the start of each chunck is the semi-human readable part which is the data like what the channel names and groups are but contains no real data.  Then the binary data follows.  The index is intended to be all the semi-human readable parts of the file, and none of the data.  This should make reading the file easier because file offsets and such can be found in the smaller index file.

 

That being said if you have some corrupt sections in your TDMS file you can still get usable data out of it.  There is some code floating around which will pull out each of the segments, and find which one is the problem, then all you to get all the data before the bad section.  This thread talks about it, and has some code posted around page 3.

 

http://forums.ni.com/t5/LabVIEW/Corrupted-TDMS-File/td-p/2165954

Message 2 of 3
(3,547 Views)

Excellent!  Your forum/google-fu is superior.

 

I was able to use the LocateCorruptedSegment code in that thread to identify the corrupt segment.  It was the last one so likely a problem in closing the file or application that was writing to it.  I was then able to use the Split TDMS.vi to take out the corrupted segment.  Data is recovered!

 

Your title of champion is well deserved!

0 Kudos
Message 3 of 3
(3,540 Views)