Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

how can i merge multiple tdms files into 1 ?

k, the following problem :
i have done some testing with an usb daq 6210 and came up with like a couple of hundreds of tdms files with the data from 12 channels. but now i would like to merge them into 1 file, so that from there i can get the complete measurement from 1 channel in the elapsed time span (and so on for the rest of the channels). any one ? i already tried the forum and examples, but i dont seem to be able to merge.
 
thanx for all of your help
0 Kudos
Message 1 of 10
(11,354 Views)
Maruska,

we're always trying to improve features like the TDMS file format, so it'll be great if you could explain why you didn't store all your data into one file to begin with. Is that just how your project developed, or did you encounter any roadblocks with TDMS itself?

I wouldn't know that we have any ready-to-use code up on ni.com that helps you merging your files. One thing you could do is using one of the TDM/TDMS converter VIs from the Storage palette as boilerplate code for your solution:
- The VIs for that are in vi.lib\utility\plat-tdms.llb. You might want to work on a copy of that Smiley Wink
- Download and install the DataPlugin for TDMS from ni.com/dataplugins.
- If you use "Convert TDM to TDMS.vi", one of the first subVIs has the string "TDM" wired to it. Replace that with "TDMS".
- Put the whole thing into a loop that loops over all your source files and writes to the same target file.

Please note that depending on how you want to concatenate your data, you might have to do some additional tweaking here and there.

Hope that helps,
Herbert

0 Kudos
Message 2 of 10
(11,336 Views)
Hello Maruska,
I wrote the appended VIs to merge several tdms files into one. The copying of the data is based on a VI out of vi.lib\utility\plat-tdms.llb as Herbert said. But it works with the tdms VIs, you do not have to install anything else. Be careful with data that exists in several source files. The data of a channel appended in the order of the source files. Properties can not be merged, therefore only the last one is copied.
 
For Herbert: In my application I want to merge several files for creating a protocol based on one ore more templates.
 
Greetings
shb
0 Kudos
Message 3 of 10
(11,297 Views)
Hi,
I am too searching a way to merge multiple TDMS-files into one. The usecase is a 2 PC setup in which one does all the DAQ-task for different UUTs (several channels per UUT) and the other is used for data analysis and viewing. To display the newest data the daq-data is transfered in 5 minute chunks (each chunk is a TDMS for a single UUT) to the display PC. Here the data is being merged into one large TDMS for viewing and analysis.
I tried the Herberts tip with replacing "TDM" with "TDMS" in the TDM to TDMS converter and it looks like it is working. But my first tests showed that this solution could run into performance problems with larger dataset.
With "shb"s tdms_copy.llb I had no luck in merging my files.

Any other ideas?


greetings from Munich
(only few days left until the Oktoberfest starts 😄  )
0 Kudos
Message 4 of 10
(10,976 Views)

Hello gbecker,

Thank you verry much for testing my VIs. I am terrible sorry, there was an error in tdms Concatanate Files.vi. I have tested the VIs, but it seems that I made a minor change thereafter. The error is corrected now and the VI is renamed to the orthographically correct name. The new lls is in the attached zip file.

I hope the VIs are helpfully now.

Greetings,

shb

0 Kudos
Message 5 of 10
(10,865 Views)
Hi again,
I ran in a strange error. I used the altered "Convert TDM to TDMS.vi" with "TDMS" as constant for some time now. Suddenly the resulting built application crashes. As far as I can tell the anywhere in _openStorageWithRoot.vi it happens and the Windows-Crash-Reporter window pops up.
I stripped the problem in the attached example. The application is built with debugging enabled, just run and pick one of the tdms-Files and hit OK.
The VI works as it has always when used in the LV-Dev-Enviroment but not in an exe anymore.
Anyone got an idea?

Greetings
G. Becker
Message 6 of 10
(10,789 Views)
Another "Hi again",

the problem I had in my last post could not be reproduced on several PCs. At the moment only my development PC and the target production PC at my customer seem to crash with the built app.

Thanks to "shb"s code I could replace parts of my application. I took the liberty to make some minor changes to the "tdms Copy.llb" and package it into a lvlib.
Attached is the source for LV8.5.

How about submitting this very useful piece of code to the Lava Code Repository, if thats ok with you shb?

Greeting
G.Becker
Message 7 of 10
(10,759 Views)

This is a very useful VI, however it is driving me nuts. I give it two similar files with different names, and is appends them together before merging the files. Any tips? Thanks!

0 Kudos
Message 8 of 10
(7,952 Views)

Did you specify the two files as source files and a new file as destination file?

0 Kudos
Message 9 of 10
(7,890 Views)

Both files were specified as source files, and the destination file was specified as well. 

 

I figured it out, but forgot to post a solution (sorry). The problem was that the source files did not have the tasks named. With both input files sharing the same task name (Unnamed default) it put them both on the same TDMS file tab. I suspect because each TDMS file tab is for individual tasks. Same task, same tab, must be the TDMS thoughts. I simply gave the tasks different names, generated the source files, and the destination file looked great. 

0 Kudos
Message 10 of 10
(7,882 Views)