Showing results for 
Search instead for 
Did you mean: 

DataSaveAdd command for tdms or tdm files


Is there an equivalent DataSaveAdd command for tdms or tdm storage?  We have a multitude of files for some tests, and we are calculating the same statistical data for specific time frames or cycles in the data.  I would like to be able to append the results of the calculations to a summary file.  Currently, I calculate the metrics and save them out on a file by file basis.  Then I append the files when I load them into the data portal.  If I could just append the data to the summary file without opening it, I wouldn't have a multitude of processed files as well.







0 Kudos
Message 1 of 5

Hello Chris@GE,


I believe you can use the function described in the Additional Information section of this document.




Diego H

National Instruments



0 Kudos
Message 2 of 5

I haven't found a way to append data with DataFileSave.  Am I missing something?  


I use DataFileSave now and it just creates another file.  If the filename doesn't change, then it overwrites the existing file.  Is there away to get it to append to the existing file?  

0 Kudos
Message 3 of 5

Hi Chris,


Try this idea out.  ( I have done similar needs and it has worked well!)


For each of the files, process them into separate summary files (say TDMS type)


Then after all the summary files are made then append them into data portal using the datafileload with append option.  (If the summary files have the same group name, and the same channel names then all the data will be now be in one group and all the Channels will be nicely appended)


Then can datafilesave that to your overall summary file.


Some caveats to this,  The Summary channels must not be waveform channels.


I believe that you can append tdms file and not require loading into portal, but Brad will have to answer that question.





0 Kudos
Message 4 of 5

Hi Chris,


If you're saving to separate TDMS files, you can DosCopy those N different TDMS files and achieve the one, large summary TDMS file you're after.  The TDMS file format supports file sandwiching, and any DOS command can be called from DIAdem with the ExtProgram() function.  Let me know if you want examples of this.


I am not aware of any way to efficiently do this at write time.  There is no DataFileSaveAdd() or DataFileSaveAppend() command as of DIAdem 2019.


If you happen to be writing to an ASCII file, you can just open it and append the new values to the end.  Not that I'm advocating using ASCII files or anything, just in the interest of completeness...


Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 5 of 5