08-15-2014 02:49 PM
Have you ever had a very large TDMS file that comes with a very large index file? Have you ever been told to defrag it so it is smaller and easier to work with? How long did it take to defrag your file? The current implementation of the TDMS Defrag is a black box with no indication that anything is happening. You simply have to wait a very long time and hope it finishes.
What I've developed is some code that gives a progress on a TDMS defrag, and allows to cancel mid way through. If you cancel, the part of the file that has been defragged will be kept. Meaning if half the file was defragged then if you defrag the file again that first half will have been taken care of.
It does this by breaking the TDMS file up into chunks. By default it will make 10 separate files from the one file. It then will defrag the first file. Then combine it with the next file, and defrag the combined file, then it will combine that with the next file and defrag the combined file. It does this until all files have been processed or until the user cancels.
The down side to this technique is the total time to defrag a file will be much longer. Still this is a first attempt and there are other techniques that could improve it performance, like defragging each of the 10 files at once and combine them. That is a bit more tricky.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
08-16-2014 01:35 AM
08-16-2014 09:13 AM
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
08-16-2014 09:51 AM
08-17-2014 08:24 PM
Hi, I like this idea and tried to play with it. However, it seems like some sub-VIs are missing for your attached VIs.
08-17-2014 08:29 PM
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
09-28-2015 09:15 AM
Update, LabVIEW 2015 now has a defrag with an option to read progress. It is a shipped example in the example finder which enables querying the progress of a defrag. Also defrag times have been improved in 2015.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
02-18-2016 01:57 PM
That is a cool new feature. Is it possible to back save the new defrag to LV2014 for those of us who have not upgraded yet?
02-18-2016 02:19 PM - edited 02-18-2016 02:27 PM
Maybe, but with a decent amount of work.
This isn't a purely G implementation and relies on the TDMS DLL at the following path for me:
C:\Program Files (x86)\National Instruments\Shared\tdms\tdms.dll
To support this progress bar new functions had to be added:
TdsFileSetDefragmentProgressSwitch_NT
and
TdsFileSetDefragmentProgressSwitch
So if you were to update your TDMS DLL, or ensure that your version does have the added functions, then a back saved VI might work. Attached is the back saved example shipped in 2015 to 2014.
EDIT: Re attached code because I forgot the vi.lib VIs.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
02-19-2016 06:05 PM - edited 02-19-2016 06:13 PM
I guess its time to install LV 2015 🙂
Actually I just tried the example in LV2014 and it worked!