From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

break large TDMS file into small files

Solved!
Go to solution

hello all

 

My TDMS file is around 3g, and needs changed into around 10M size files. 

 

I ran McRorie's splitFiles.vi ‏15 KB in this page and set the number of samples per file as 5000000, however, I cannot get the results I need. every small file is only 1KB, and no data inside. What is the possible problem in this?

 

Also, I tried to write a vi based on sample vi(Read TDMS File) by adding one "write to measurement file.vi". However, when I set the small file size as 10M Byte inside the"write to measurement file.vi", the first file could be around 20M, and the next few files may be correct as 10M, and then it just stop splitting, edding with a file even much larger than original file. I uploaded my vi here, maybe someone  can help to find some mistake for me. 

 

Thanks very much!

 

Wuwei Mao

0 Kudos
Message 1 of 4
(3,861 Views)
Solution
Accepted by topic author bryantt

Hi Wuwei,

 

After giving the correct data type to TDMS Read node in splitFiles.vi, it works as expected. ( See the attached two VIs: createFile.vi and the modified splitFiles.vi)

 

Because I don't know how you created your TDMS file, I write a new 3G bytes TDMS file, which has one group and one channel. The data type of samples is unsigned 16-bit Integer. The total number of samples is 1610612736. Then I set the number of samples per file to 5000000 as you did. So after splitting, each file size is 5000000*(16/8) bytes (around 10M bytes).

 

Please make sure the followed steps have been done before you run the splitFiles.vi:

1. The TDMS file will be split has been put on the proper path;

2. The correct group and channel names have been given;

3. The correct data type to TDMS Read node has been given.

 

Because your second option using "write to measurement file.vi" to split TDMS file will lose some information, such as group and channel names. So I suggest using the method used by splitFiles.vi to accomplish your goal.

 

Jie Zheng

NI R&D

Message 2 of 4
(3,650 Views)

Adding attachment is not available just now. I will attach createFile.vi and splitFiles.vi when adding attachment works.

0 Kudos
Message 3 of 4
(3,648 Views)

Hello, Zheng,

Thank you very much for your kind reply.

 

Yes, I succeeded to split the tdms file now. I made some mistake in the steps you mentioned. it is important to set the correct group name. 

Thanks again!

 

Wuwei Mao

0 Kudos
Message 4 of 4
(3,628 Views)