Automatic Import of TDMS file into Excel

I was looking at the NI TDMS import plugin for Excel and it seems that the newest version of the plugin uses the COM API which could allow the import function to be used automatcially. There is a short info page about this here http://zone.ni.com/devzone/cda/tut/p/id/10207 but I'm new to Excel Macros and VBA so I'm not sure how to go from this tutorial to what I am wanting to do.
Specifically, I am wondering if anyone knows (and could post an example of) how to do the following:
From within a labview VI, the user would select a path to a tdms file. Once this path is selected, the VI would call the TDMS import excel plugin and run it on the file.
Solved!
Go to Solution.

After playing with things, I have worked out the solution to this and I am posting it for everyone in case it can be of some use. In order to use this solution to work out of the box, you will need the report generation toolkit. If you don't have that, you would need some other way of launching Excel from labview and running a macro. Hopefully someone who has the knowledge on how to do that will post that portion in this thread for those who don't have the toolkit
To start out, open excel and in the menubar select Tools -> Macros -> Visual Basic Editor. The source for the macro you will create is:
Sub TDMImport(fileName)
'Get TDM Excel Add-In
Dim obj As COMAddIn
Set obj = Application.COMAddIns.Item("ExcelTDM.TDMAddin")
obj.Connect = True
'Confirm only importing "Description" properties for Root
Call obj.Object.Config.RootProperties.SelectAll
'Show the group count as property
Call obj.Object.Config.RootProperties.Select("Groups")
'Select all the available properties for Group
Call obj.Object.Config.GroupProperties.SelectAll
'Import custom properties
obj.Object.Config.RootProperties.SelectCustomProperties = True
obj.Object.Config.GroupProperties.SelectCustomProperties = True
obj.Object.Config.ChannelProperties.SelectCustomProperties = True
'Import the selected file
Call obj.Object.ImportFile(fileName, False)
'Record down the current workbook
Dim Workbook As Object
Set Workbook = ActiveWorkbook
End Sub
Once you have copied/pasted this into the editor go to the menubar and hit File -> Export File and save the macro as a .BAS file
You will also need to go to Tools -> Macros-> Security and select the Trust Visual Basic Project option in order for the macro to be called from LV.
Once all this is done, you can use the attached VI (Saved in LV 8.6) Simply supply the path to the BAS file and the TDMS file via the front panel controls and click run and the TDMS import will happen automatically.
Attachments:
Automatic TDMS Excel Import.vi ‏14 KB

Similar Messages

  • Importing several CSV files into Excel

    Hello Everyone,
    I managed to piece together this code which runs several powershell scripts that each output a CSV for every day of the week.
    Next, I located a function that takes a CSV file as input and exports that as a worksheet in an Excel document.
    My problem is, the last column in the Excel file should be the first column and I just cannot spot why this behavior is occuring.
    #First phase, output CSV files used later in the script.
    Monday.ps1
    Tuesday.ps1
    Wednesday.ps1
    Thursday.ps1
    Friday.ps1
    Saturday.ps1
    Sunday.ps1
    #Now the function to export the CSV from Phase 1 into an Excel Spreadsheet.
    function Export-Excel {
    [cmdletBinding()]
    Param([Parameter(ValueFromPipeline=$true)][string]$junk)
    begin{
    $header=$null
    $row=1
    process{
    if(!$header){
    $i=0
    $header=$_ | Get-Member -MemberType NoteProperty | select name
    $header | %{$Global:ws.cells.item(1,++$i)=$_.Name}
    $i=0
    ++$row
    foreach($field in $header){
    $Global:ws.cells.item($row,++$i)=$($_."$($field.Name)")
    $xl=New-Object -ComObject Excel.Application
    $wb=$xl.WorkBooks.add(1)
    $Global:ws=$wb.WorkSheets.item(1)
    $Global:ws.Name='Sunday'
    import-csv 'C:\Sunday.csv' | Export-Excel
    $Global:ws=$wb.WorkSheets.Add()
    $Global:ws.Name='Saturday'
    import-csv 'C:\Saturday.csv' | Export-Excel
    $Global:ws=$wb.WorkSheets.Add()
    $Global:ws.Name='Friday'
    import-csv 'C:\Friday.csv' | Export-Excel
    $Global:ws=$wb.WorkSheets.Add()
    $Global:ws.Name='Thursday'
    import-csv 'C:\Thursday.csv' | Export-Excel
    $Global:ws=$wb.WorkSheets.Add()
    $Global:ws.Name='Wednesday'
    import-csv 'C:\Wednesday.csv' | Export-Excel
    $Global:ws=$wb.WorkSheets.Add()
    $Global:ws.Name='Tuesday'
    import-csv 'C:\Tuesday.csv' | Export-Excel
    $Global:ws=$wb.WorkSheets.Add()
    $Global:ws.Name='Monday'
    import-csv 'C:\Monday.csv' | Export-Excel
    $xl.Visible=$true

    That is interesting considering this script I found on Hey Scripting Guy.
    http://blogs.technet.com/b/heyscriptingguy/archive/2010/09/09/copy-csv-columns-to-an-excel-spreadsheet-by-using-powershell.aspx
    I have run your version above and have no issues with order. 
    I still recommend using WorkBook.OpenText($csvfile)
    and
    $wb.Sheets($csvfile).Move($wb2.Sheet(1))
    This is much faster and takes much less code.
    ¯\_(ツ)_/¯
    Could you give a terse example?  I'm trying to put something together but am not having much success.
    $sheets = @(LS D:\Scripts\work | select FullName -ExpandProperty FullName)
    $Excel = New-Object -ComObject excel.application
    $Excel.visible = $false
    $file = $Excel.Workbooks.Open("C:\tmp\mytest.xlsx")
    #$wb2 = $file.Sheets
    for ($i=0; $i -lt $sheets.length; $i++)
    $workbook = $Excel.WorkBooks.OpenText($sheets[$i])
    $workbook.Sheets($sheets[$i]).Move($file.Sheet(1))
    $Excel.visible = $true

  • Skip a column when importing a text file into Excel 2010

    Hi,
    I have a formatted Excel 2010 spreadsheet that I want to import data from a .txt file located on my local drive. The third column of the spreadsheet is a concantenate formula that converts the second column from a Hex formatted value to a Dec formatted value.
    I want the first two columns of the text file to import into the first two columns of the spreadsheet and skip the third column then import the remaining columns from the text file to the spreadsheet. Is there an easy way to do this or do I need a VBA code
    and if so can you provide that to me?
    Thank you,
    Jennifer

    Hi Tony,
    I am sorry if I didn't express my issue more clearly. Where I need to skip a column is in the Excel spreadsheet. I want to import all the columns from the text file. I want the first two columns from the text to import to the first two columns in the Excel
    sheet A and B, skip the third column C in the spreadsheet, where I have a formula to convert the second column B values from a Hex format (imported data) to a Dec format, then continue to import columns 3, 4, and 5 from the text to spreadsheet columns D, E,
    and F. I would think the function would be in the Excel spreadsheet maybe some type of protection setting or something similar, if it can even be done. 
    Thank you for taking the time to help me out with this.
    Jennifer

  • Getting "... file has and invalid format. (Error no. 11)" when importing .tdms file into DIAdem 11

    I developed a script for processing .tdms files in DIAdem 11.1, now I'm deploying the script on the very PXI system that created the .tdms files.  This system had DIAdem 11.0, but when I try to open (DataFileLoadSel) the tdms file in my script I get the error message:
    "D:\MyFileName.tdms" has an invalid fiel format.  (Error no. 11)
    The tdms files are created by a LabView application.
    If I delete the correspondin .tdms index file, I get a little further, it loads the first two of four groups, using DataFileLoadSel on the first group, and DataFileLoadRed on the 2nd group, on third group, another DataFileLoadRed, I get the following error:
    Error in <MyScript> (Line: x, Column: y):
    Cannot load the file "D:\MyFileName.tdms" with the loader "TDMS"
    Further information:
    Cannot open the file "D:\MyFileName.tdms".
    Is there a difference between DIAdem 11.0 and 11.1 that affects the import of .tdms files, if so, can I get around it?
    Thanks,
    Eric
    Solved!
    Go to Solution.

    Hello eberg,
    Before we go into more detailed error trapping, could you please try to install the TDMS 2.0 format on the DIAdem 11.0 computer (DIAdem 11.1 and LabVIEW 2009 come with the TDMS 2.0 stuff already installed).
    Please get the download here: http://zone.ni.com/devzone/cda/tut/p/id/9995
    Once installed, please try running the Scripts again (in DIAdem 11.0) and let us know if that fixed the issue. It might not help to install this, but it's a quick thing to try before we dig deeper into the issue.
    Best regards,
          Otmar
    Otmar D. Foehner
    Business Development Manager
    DIAdem and Test Data Management
    National Instruments
    Austin, TX - USA
    "For an optimist the glass is half full, for a pessimist it's half empty, and for an engineer is twice bigger than necessary."

  • Bizarre problem trying to import .MTS (AVCHD) files into PSE7 Organizer

    Hi
    b Summary of problem:
    *I recently upgraded to PSE 7 / PRE 7
    *I am trying to import .MTS (AVCHD) files into the PSE7 Organizer
    *I get a "...did not contain any supported file types..." error on attempted import
    b HOWEVER...
    *I can edit same footage in PRE7
    *This footage is automatically added to the Organizer
    *I can play this footage in the PSE7 organizer but generating thumbnails takes ages
    *Camera: Sony HDR SR12 producing .MTS files (full 1920x1080i HD)
    *PC: Intel Core i7 940 CPU, 6GB RAM, RADEON HD 4870 512MB
    *OS: Vista 64 bit
    b Detail:
    I have recently upgraded my PRE/PSE bundle to ver 7 primarily because the new version of PRE boasts support for AVCHD.
    Having installed the new software I quickly tried editing footage in PRE7 with video taken on my Sony HDR SR12 camera (footage taken in full 1920x1080i HD) and it works! Hoorah! I can now finally edit AVCHD footage in it's native format using PRE. Thank you Adobe!
    But my joy was very shortlived because when I tried to import some other footage from the same batch into my PSE7 Video Catalog it wouldn't work. I got a pop up box containing the following error:
    i "Nothing was imported. The file(s) or folder(s) selected to import did not contain any supported file types, or the files are already in the catalog."
    Under this message is a list of the files that I tried to import. Next to each one there is a reason (it's the same reason for each clip):
    i "Reason: The file is damaged or is a format that cannot be included in the Organizer."
    To import files I use the following method: File / Get Photos and Videos / From Files and Folders
    HOWEVER, the files that I imported directly into PRE7 in order to edit them have (surprise, surprise!) automatically been added PSE7 Organizer's Catalog. It takes a quite a while to generate a thumbnail for each clip but it does eventually do it and when it does I can play that footage in PSE7.
    Just in case you're confused by this stage... If I try and manually add files to the PSE7 Organizer it doesn't work BUT if I edit that footage in PRE7 and then load the PSE7 Organizer I see the footage has been automatically added. This makes no sense whatsoever!
    Am I doing something really stupid here? Why oh why will the PSE7 Organizer not import .MTS (AVCHD) files?!
    NB: While searching for a solution to this problem I have, thanks to this Forum, found out about the K-Lite Codec Pack. I downloaded and installed the Basic pack v4.4.5 and now I can, at least, play my .MTS video files in Windows Media Player... I wish I had found out about that a couple of months ago because it would have saved me from buying Cyberlink PowerDVD 8!
    Please someone help before I lose the plot.
    Thanks
    Patrick
    b PC: Intel Core i7 940 CPU, 6GB RAM, RADEON HD 4870 512MB, Vista 64 bit
    b Camera: Sony HDR SR12 producing .MTS files (footage in full 1920x1080i HD)

    Hi
    I'd just like to add an update to this post.
    b Summary:
    *K-Lite Codec Pack clashes with Sony's Picture Motion Browser (PMB) software
    *Analysis of video in Sony's PMB is well worth doing!
    *You can Drag and Drop clips from Sony's PMB into PRE7
    b Detail:
    As you've probably gathered I have now settled on using Sony's Picture Motion Browser (PMB) to Catalog all my video. Sorry Adobe to talk about someone elses product but the Adobe Organizer just can't cope with AVCHD footage no matter how you manage to import it! It's far too sluggish and my PC has an Intel Core i7 940 CPU with 6GB RAM and a 10,000 RPM HDD!
    Anyway, in my first post you'll have read me raving about the K-Lite Codec Pack but sadly I've had to uninstall it because it kept on causing PMB to crash. PMB runs much smoother and quicker WITHOUT that codec pack. Something about it clashed with PMB. The once agile PMB became sluggish and unresponsive.
    Having now removed the codec pack PMB is back to being agile and generaly lovely.
    To view AVCHD footage outside of PMB I have reverted to using Cyberlink's PowerDVD 8 - there's always a pregnant pause between double-clicking on the clip and it playing but that's the only drawback.
    If you are going to use Sony's PMB for cataloging your video collection (and I recommend you do so BUT only if you have AVCHD footage - otherwise stick to Adobe's Organiser) then I can fully recommend "Analyzing" all of your footage. This takes time and a bit of patience because it kept stopping for no apparent reason but would readily start up again (without having to do anything else) BUT once it's done it'll reward you with the following:
    *Filter on any combination of Scenery, People, Smiles - e.g. with a click of a button you can isolate footage that contains smiles, etc
    *Face Search - if you select some or all of the footage in the right-hand pane it will then put a small thumbnail for all of the different faces in that selected footage in the bottom "Face Search" pane. If you then click on one of those thumbnails it will jump to the clip(s) that contain that face and grey out all the other clips
    *Expand Videos - This tool is brilliant! In normal viewing mode you get a thumbnail of the video whether you're in Folder view, Calender view or Detail List view. If, however, you select "Expand Videos" from the tool bar it will show you a series of frames contained within that clip. You can choose from "Highlights" or various regular intervals (5 secs, 10 sec, 30 sec, 1 min, etc). The Highlights option does a pretty good job of picking out the significant changes within the clip
    Lastly, I have discovered that you can drag a clip from Sony's PMB into PRE7. It won't let you put it directly onto the Timeline but it will let you drop it into the Project file list (found under the Edit tab).
    I do hope that this info has helped others like me who are trying to get to grips with editing and cataloging AVCHD footage.
    Patrick

  • How to import a XFDF file into a PDF?

    I need to import a XFDF file into a PDF through javascript.
    Manually in Acrobat 8.0 we are doing through the following steps.
    Comments->import comments->browser window open(select the corresponding xfdf file and then click select button)->After that save that pdf file. Kindly help me how to automate this process through programmatically.
    Thanks,
    Prabudass

    See your posts in the other forums.

  • How do I import an MKV file into Premiere Pro CS6?

    How do I import an MKV file into Premiere Pro CS6?

    Premiere Pro CS6 doesn't support MKV formats. To import MKV to Premiere Pro CS6, a recommended solution is to convert MKV to AVI.
    I've been reading so many different forums on how to convert MKV to AVI. Finally, I summarised three solutions:
    First one: HandBrake . This tool is a free and open-source multi-threaded transcoding app. It supports nearly any videos including MKV format and has Mac version and Windows version.
    Cons:
    1. HandBrake is too professional to handle for most people;
    2. It doesn't support MOV as output format.
    Second one: there are many third party software which supports converting MKV to AVI. I just test one of them. It's professional yet easy to use and the service is excellent. And there is a step by step guide about how to use this tool .
    Cons:
    1. Most of them are not free.
    Third one: Online-Converter . This kind of converter does a great job on file conversion.
    Cons:
    1. Like most online converters, the free version of this tool only allows you to convert videos smaller than 100MB. It's too small for video conversion;
    2.Your MKV video should be upload to the internet to be converted. This means the risk of pravite information leak is possible.

  • Can I import Mac alias files into Premiere Pro CC?

    I am trying to keep my folder structure clean and organized, and am using alias files to gather miscellaneous B-roll video files into a new project folder without removing them from their permenant location and without creating duplicates. Alias files on a mac are basically shortcuts to the original file. FCP 7 and FCP X will import these alias files with no problems, but when I try to import them into Premiere Pro, it says they are unsupported file types. Is there any way to make this work?

    Thanks, I was prepared to hear that I would have to make a copy. One note though, is that when i import the alias file into a Final Cut Pro project, it automatically links to the original permanent file location, so if the alias gets deleted, it doesn't matter becuase it is linked to the original.
    To answer your question, though, the idea for using alias files is to keep the server clean, so that multiple video editors don't keep copying the same files multiple times into their project folders when they start a new project, and then no one goes back and cleans it up, so you end up with Terabytes of duplicate files on the server. I guess the other option is to train everyone to hunt for the original files themselves and import from that location instead of their own project folders.

  • Is there a way to import a .csv file into Numbers?

    Can I import a .csv file into Numbers?

    Yes, you can import csv (character-separated-values) into Numbers.
    If the csv file is comma-separated, then in Numbers you can try File > Open and navigate to the file and open it.
    If you don't get the results you want, then try this CSV to Tabs on Clipboard Automator Service (Dropbox download) instead.
    To install, double-click the .workflow package and, if necessary, click 'Open Anyway' in System Preferences > Security & Privacy.
    Thereafter to use:
    In Finder (not Numbers) navigate to the .csv file.
    Right-click on the file and choose 'CSV to Tabs on Clipboard' under Services in the contextual menu.
    Follow the prompts (trying different separators if needed).
    Click once in a Numbers cell.
    Command-v to paste.  The Numbers table will expand automatically as needed.
    These steps are quicker and easier than they sound. Just a few clicks and a keyboard entry.
    SG

  • Does anyone know how to read in a TDMS file into Matlab?

    I am trying to read a TDMS file into Matlab. Are the two compatible? How can I import this file into matlab?

    A search can turn up wonderful things, such as:
    Reading TDM/TDMS Files with The MathWorks, Inc. MATLAB® Software

  • Dynamically importing a .mov file into flash

    Hi,
    I need to import a .mov file into a flash file and create a
    .swf movie. I can do it through File > Import Movies option. But
    I want to make it dynamic and import the movie. I would like to use
    ActionScripts rather than the File> Import options. Pls let me
    know if this is possible. Let me know if you have any questions.
    Appreciate any help.
    Thanks & Regards,
    Magesh

    You can only dynamically load at runtime FLV movies.
    You can automate the authoring time environment but this is
    only with the Authoring tool. See
    Extending
    Flash

  • Importing a WAR file into WebLogic 8.1

    Hello,
    First post here so go easy on me :-D
    Is it possible to import a WAR file into WebLogic 8.1? If so, how?
    I have a WAR file created using Eclipse and want to test if I can take that WAR file and rebuild the project in WebLogic.
    Any help is appreciated?
    Thanks,
    Tommy

    I,
    your domain should be started in developement mode. Then, just copy your
    war file in the "applications" directory under your domain directory.
    Emmanuel
    Tommy Dunne a ?crit :
    Thanks Emmanuel, I had a look at that link you sent me.
    Im still isnt 100% clear to me...In tomcat when you have a WAR file you can just put it in the webapps directory and tomcat will automatically expand it for you and you can run the application straight away.
    Is there such functionality in weblogic? How do you get weblogic to see the WAR file? Do you have to create a project or anything?
    Sorry if this is a very basic question...

  • I am trying to import quicktime audio files into FCPX and it's saying they're not suppored - Help?

    I am trying to import quicktime audio files into FCPX and it's saying they're not suppored … Help?

    Here is the How to import in itunes 11. Including the Join tracks option.
    http://support.apple.com/kb/PH12278
    Also if you have imported them then  this article gives a good understanding of how to tag these songs
    http://samsoft.org.uk/iTunes/audiobooks.asp
    the other option would be to use an App like Audiobook Builder to stitch the tracks together in upto 12 hour long sections and sends to itunes automatically. It is available in the App Store. There are others available, Audiobook binder is free

  • How do I import one xml file into 3 separate tables in db?

    I need to utilize xslt to import one xml file into 3 separate tables: account, accountAddress, streetAddress
    *Notice the missing values in middleName, accountType
    sample xml
    <account>
    <firstName>Joe</firstName>
    <middleName></middleName>
    <lastName>Torre</lastName>
    <accountAddress>
    <streetAddress>
    <addressLine>myAddressLine1</addressLine>
    <addressLine>myAddressLine2</addressLine>
    </streetAddress>
    <city>myCity</city>
    <state>myState</state>
    <postalCode>mypostalCode</postalCode>
    </accountAddress>
    <accountId>A001</accountId>
    <accountType></accountType>
    <account>
    I need the following 3 results in 3 separate xml files in order for me to upload into my 3 tables.
    Result #1
    <rowset>
    <row>
    <firstName>Joe</firstName>
    <lastName>Torre</lastName>
    <accountId>A001</accountId>
    <row>
    <rowset>
    Result #2
    <rowset>
    <row>
    <addressId>1</address>
    <city>myCity</city>
    <state>myState</state>
    <postalCode>myPostalCode</postalCode>
    <row>
    <rowset>
    Result #3
    <rowset>
    <row>
    <addressId>1</addressId>
    <addressLineSeq>1</addressLineSeq>
    <addressLine>myAddressLine1</addressLine>
    <row>
    <row>
    <addressId>1</addressId>
    <addressLineSeq>2</addressLineSeq>
    <addressLine>myAddressLine2</addressLine>
    <row>
    <rowset>

    Use XSU to store in multiple tables.
    "XSU can only store data in a single table. You can store XML across tables, however, by using the Oracle XSLT processor to transform a document into multiple documents and inserting them separately. You can also define views over multiple tables and perform insertions into the views. If a view is non-updatable (because of complex joins), then you can use INSTEAD OF triggers over the views to perform the inserts."
    http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b14252/adx_j_xsu.htm#i1007013

  • I can't import my iTunes files into pages, how can i fix the privileges problem?

    when i try to import any mp3 file into a pages document, i get an access privileges error saying it is either corrupt, damaged or "can't be used" because I don't have access privileges. This has happened since I moved my iTunes library to an external drive.  Anyone have any solutions?  The privileges on both the library folder, and all its files are set to read and write for sharing and permissions.

    If you do not have done so, set the "Ignore Ownership" flag on the external drive. YOu can set this flag from the "File > Get Info" panel for the drive.
    How is your external drive formatted?
    Can other applications open these mp3 files? QuickTime? Do they play in the Finder preview?
    Do the filenames contain special charcters?
    Léonie

Maybe you are looking for