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.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple file operation

Solved!
Go to solution

Hi. I am new to Diadem scripting and need to write a script to perform a data treatment task on a large number of daily measurement TDMS files (sequentially numbered). The script needs to open each file individually (as they are very large), save the result in a new file, repeat for the next file and so on. I cannot find any such example on the exchange forum or in postings but apologies if this already exists.

 

Would anybody have a simple example script of something similar which I could modify? I just need an idea of the main commands.

 

Many thanks 

0 Kudos
Message 1 of 9
(6,335 Views)
Solution
Accepted by topic author Mark_A

Hi Mark_A,

 

I have a script I can send you to do this, but first let me ask you a few questions.  What file formats are your incoming data files in?  If they're in some file other than TDM or TDMS, do you already have a DataPlugin that loads those files into DIAdem?  Can you send me some of your data files so that I can test the script before I send it to you?  Do you want to do any processing of the data when each data file is loaded into DIAdem, or do you just want to re-write the data from DIAdem to disk?  What is your desired output file format?

 

Brad Turpin
DIAdem Product Support Engineer

National Instruments

brad.turpin@ni.com 

Message 2 of 9
(6,321 Views)

Hi Brad 

 

The incoming files are in TDMS format so there is no problem loading them. Yes each file needs to be processed individually but the result can be written directly to disk. The desired output form is also TDMS. I will prepare a few sample files and email to you.

 

Thank you,

Mark

0 Kudos
Message 3 of 9
(6,302 Views)

Brad,

Could I ask you to send this to me as well? 

 

I have (36) .tdms files that I would like to report in the exact same way.  Here is what I would like to do, but I haven't been able to figure it out. 

 

First question:  do I/can I load all (36) files into the Data Portal: Internal Data? (Note: all of the files have the same channel names for the channels I will be analysing/reporting)

If possible, I would like to report all (36) files at once, because I will be doing this again later. 

 

Here is what I would like to do: 

1)  2-D Display Report with 3 channels plotted against System Time

2)  Second 2-D Display Report with 2 channels, newly created by Curve Smoothing (100 points) plotted against System Time

3)  Move to Report

4)  I would like to have all 36 reports exactly the same.  I'll have the legends and file name at the same location for each report Sheet.  I'll also add a text box and a company log in the .TDR file. 

5)  Create 36 Report Sheets

6)  Create a 36-page PowerPoint file

7)  Save (overwrite) each of the 36 .tdms files to include the (2) new smoothed channels

 

Thanks!

 

0 Kudos
Message 4 of 9
(5,353 Views)

Brad,

 

Could you share the examples with everyone, because I have a simiular problem like ATarman.

 

I want to process all the *.tdms files in a folder

But instead of creating 1 report for each file 1 whant to creat 1 report with a summary of all the files.

It should also be great if 1 could add new folders to the summary file.

 

Best regards,

 

Jelle

 

 

0 Kudos
Message 5 of 9
(5,061 Views)

Hi SnelleJelle,

 

I do not have code I can send you that will fulfill your request:

 

"1 whant to creat 1 report with a summary of all the files."

 

This is too vague.  What kind of summary are you thinking?  Tabular, graphical, one sheet, multiple pages, statistics, outliers, what?

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 6 of 9
(5,036 Views)

Hi Brad,

 

Because I'm new to the world of diadem en the scripting world

The summary report is not really fancy

Only 1 sheet with a 2-D Display Report , no statistic calculations, for the moment;)

 

We are doing an endurance test, with some intermediate checks (Force travel measurement)

The raw data of each measurements are stored in seperated folders.

This data is analysed (smoothed, .. ) and should be reported against all the previous measurments

 

To make my life easier, I made 1 summary file.

Which contains all the wanted data, each measurement in a seperated group and create a view -> report from this data

 

But I should prefer to create the report directly from the different files without creating the summary file.

Wost case I have to create a script which is able to add a new folder/file to the summary file and update/ add new data to the report.

 

an exmaple of both solutions is appreciated 😉

 

Download All
0 Kudos
Message 7 of 9
(5,013 Views)

Hello Brad. Can you please share that script with me also?

Currently I'm draging 1 .asc file at a time and I need to:

1 Filter

2 Re sampling

3 Remove not used channels

4 Rename remaining ones and

5 Save as new TDM file

 

I have the script working so far for only 1 file, but I can't figure it out to do it for several files in automated way.

THANK YOU!!!

0 Kudos
Message 8 of 9
(3,039 Views)

Hi All,

 

Wow, what an outcry!  Here's the script I prepared for Mark many years ago.

 

Brad Turpin

Senior Technical Support Engineer

National Instruments

Message 9 of 9
(3,021 Views)