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: 

importfile

I am writing a VBA script in Excel to read TDMS files.  I am able to load the files, but some channels have more than a million rows.  When I open a TDMS file by clicking on it, I get the “Select Index” dialog box if the number of rows is too high for Excel.  I’d like to use the ImportFile method in silent mode and if the number of rows in the file is too high, automatically read the file into two Excel sheets.  To do this, I think I need to know the number of rows in the file so I can calculate an index and read the file into the 2nd sheet using this index.  I also need to know how to set the index property to a value.  The following code works to open the file, but I'm having trouble getting the methods and properties defined in http://www.ni.com/white-paper/10207/en/  to work. 

 

Set obj = Application.COMAddIns.Item("ExcelTDM.TDMAddin")
Call obj.Object.ImportFile(FilePath)

0 Kudos
Message 1 of 7
(5,408 Views)

Hi LMMiller,

 

The method to load a selected row range from a TDMS file does not yet exist in the TDM Excel Add-in.  This was requested recently, and R&D is looking into how much effort it would take to add it.  The TDM Excel Add-in is not tied to the DIAdem release cycle, so new features could appear at any time.

 

Stay tuned,

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 2 of 7
(5,370 Views)

Thanks. 

0 Kudos
Message 3 of 7
(5,365 Views)

Is there any update on this ability?

0 Kudos
Message 4 of 7
(3,189 Views)

Hello,

 

We really don't know if there is anything about this. Unfortunately, I guess it will be required to monitor the future releases "release notes" to find out if the functionality was implemented, but even knowing R&D knows about this, we don't have a way to predict when they will work on it.

 

Hope I could provide a better insight.

 

Regards,

Camilo V.
National Instruments
0 Kudos
Message 5 of 7
(3,170 Views)

Ok, thanks.

0 Kudos
Message 6 of 7
(3,152 Views)

Hello LMMiller,

 

I have checked with the R&D team, and adding this functionality is not in the development plan for the foreseeable future.

 

An alternative way to get where you need to be is to load the data to DIAdem first and "prepare" it for the Excel load process. You could partition all channels with more than 1,000,000 values using a Script and then save a new file that has additional, indexed channels for the channels that were partitioned (so a channel with 3 million values that is called "Test Data" would be separated into three channels called "Text Data 1", "Test Data 2" and "Test Data 3", each 1,000,000 values long). The GetValues and SetValues functions should do this with good performance.

 

For the foreseeable future, I think that's the best way to automate that process. The TDM Excel Add-in seems to work well for most customers, so this feature request is not high on the R&D list. You could list this feature request in the DIAdem Ideas forum and have people vote on it to gauge interest from the larger user community.

 

I hope this helps,

 

      Otmar

Otmar D. Foehner
0 Kudos
Message 7 of 7
(3,144 Views)