02-22-2023 03:49 AM
Hello,
I have 17 data files (.tdms) stored in local folder. In my script, now, I use --Call DataFileLoad(autoactpath&test1&".tdms","TDMS","Register") to load all files (run this command x17 times with different input :test1,test2...test17). Is any method to load automatically this data ? I want to keep my variabile name (test1,test2...) just to not modify all script.
Now, my script is kind of:
test1= InputBox("File name no. 1")
test2= InputBox("File name no. 2")
.......................................................
Call DataFileLoad(autoactpath&test1&".tdms","TDMS","Register")
------do someting----------
Data.Root.ChannelGroups.Remove("Data")
Call DataFileLoad(autoactpath&test2&".tdms","TDMS","Register")
------do someting----------
And so on.
Thank you in advance.
02-24-2023 01:04 AM
Hi Alex_SI,
You can try this script:
dim sSearchFolder, sFileListArray, iLoop, sFullFileName
sSearchFolder = "d:\Test\xxx\"
sFileListArray = DirLstWrite(sSearchFolder, "*.TDM", "filename", , 0, "FullFilenames")
for each sFullFileName in sFileListArray
call Data.Root.Clear
call DataFileLoad(sFullFileName)
' do something
next
Greetings
Walter
03-01-2023 07:39 AM
Thank you so much. All works fine.
Could you also help me with print a report ?
Or should I open new topic?
03-02-2023 12:34 AM
Hi Alex_SI,
You can enable the recording mode in DIAdem to get command for scripting like:
All relevant script commands are recorded in SCRIPT
Greetings
Walter