DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Individually load all TDM files in folder

Solved!
Go to solution

Here's what I'm looking to do.

 

1) Point DIAdem to a folder

2) Load first TDM

3) Perform Calculation

4) Save and close TDM

5) Load next TDM, and repeat for every TDM in the folder

 

I've come up with a script that I believe works, however it runs very slow. Is there anything I can do to speed it up?

 

Dim File, iCount, Directory

'-- Set Directory Path
Directory = "C:\_Processed Data"

'-- Load All TDM Files from Directory
File = DirListGet(Directory, "*.TDM", "filename", "FullFilenames")


For iCount = LBound(File) To UBound(File)
		Call DataFileLoad(File(iCount))
		'-- Calculations
		Call ChnIntegrate("[1]/Time","[1]/Pelvis RY","[1]/Pelvis Rotation RY","TrapezoidalRule",0,0,0)
		'-- Save and Clear
		Call DataFileSave(Directory&"\"&Data.Root.Name&".TDM","TDM")
		Call Data.Root.Clear()
	Next
Message 1 of 3
(3,388 Views)
Solution
Accepted by topic author TamerZero

Hi Tamer,

 

Your script looks OK to me.  If you want to know where your execution bottlenecks are, I suggest you turn on the Script Profiler in the SCRIPT panel and re-run your script.  It will give you a command-by-command breakdown of where your script is spending its time.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 2 of 3
(3,348 Views)

Thanks Brad

0 Kudos
Message 3 of 3
(3,342 Views)