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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS Defragment-Through Windows Command Prompt

Dear All,

 

we need to Defragment the TDMS file  by TDMS Defragment.VI  via Windows Command Prompt.

 

 

Work flow will be as below

 

1.An Application wil be created to defragment using TDMS Defragment.VI

 

2. When user stop Main Application (App 1) which records data for long time in tdms  ,the Main application (App 1)  will call defragmenting Application (App 2) via cmd and should get the file path and start defragmentation and it should pop a message defragmentation completed. and dont want Main Application  (App 1)  to do anything apart from triggering tdms defragmentation.

 

Reason is We dont want the Main Application (App 1)  to wait for Long time till defragmentation and Since we need to use the Main Application (App 1)  for other testing.

 

So we decided to do this defragmentationin in some other way  and display the completion message to user

 

please provide suggestions 

0 Kudos
Message 1 of 3
(3,726 Views)

Sounds like a pretty good candidate for a Master-Slave architecture.

 

Setup a queue with with the pathname to the TDMS as the data element.

Have your main App enqueue the path and setup a parallel loop to dequeue the path and start the defragmentation.

 

Your main app will continue to run uninterrupted while the slave loop works on the defrag and posts the completion message.

 

Alternatively, you might just be able to call TDMS Defrag Asynchronously using the Start Asynchronous Call functions.

 

EDIT: Asynchronously is difficult to spell 🙂

0 Kudos
Message 2 of 3
(3,711 Views)

I'd also recommend doing this in one application.  If you truely want to do it from a command line you can.  LabVIEW built EXEs can support command line switches if you enable it in the build specificaitons.  If you do this you'll probably want to support multiple instances, and code it so that it will exit once the conversion is done.  But again you can get more information from the result of the defrag (like error) if you do it in the same application.

 


@Taki1999 wrote:

 

EDIT: Asynchronously is difficult to spell 🙂


Totally agree and some spell checks claim it isn't a word.  Same with programmatically.

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