03-11-2010 09:06 AM - last edited on 07-10-2024 02:51 PM by Content Cleaner
So I have some LabVIEW code which logs to TDMS just fine. I installed the TDMS Excel Add on to Excell 2007 and it imports the TDMS just fine and it looks good.
What I would like do do now is instead of just having that TDMS file, I would also like to have the XLS equivalent as well. As if I imported the TDMS in Excel, and then went to save the workbook as XLS or XLSX. So I wanted to programatically import the TDMS file, get the active workbook from Excel, and then programatically save the active workbook as XLS, or XLSX in the same directory as the original TDMS.
I'm having problems with the first step of my plan. I see here there are some details about how to call the TDMS import using ActiveX but when I use it I get an error. Calling ShowAboutDlg or ShowConfigDlg work just fine, but when I call the Import it I get a "An unknown error occured: 0x80004003" which I believe is a invalid pointer.
Attached is the VI I was using to try to import a TDMS file. Saved in 8.20, running TDM Importer 3.1.0.25, with Excel 2007, on XP SP3. Thanks.
EDIT: The VI is pointing to a TDMS file which comes with LabVIEW 2009, this path may need to be changed.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
Solved! Go to Solution.
03-11-2010 08:11 PM
Hi Hooovahh,
From the TDM Excel Add-In name, you can see it can't live without Excel:)
So you need create Excel._Application first before you using ExcelTDM Automation.
You can use the following G code to import TDMS file.
03-12-2010 02:20 PM
Thanks alot ykdoubles, your VI was very helpful. With it was able to accomplish my goal of being able to convert from TDMS to .XLSX using Excel and the add on. Here is what I came up with for anyone that's interested.
If you have Excel 2003 it may not work, or you may just need to update some of the calls.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
04-15-2010 05:36 AM
I tried your TDMS to Excel VI but it seems that a subVI is missing and caused errors in my LabView, 8.6 version.
A dialog box come up asking for "Strip path extension__ogtk.vi", any idea what it is?
04-25-2010 12:37 AM
05-09-2010 08:08 AM
i have installed the "OpenG toolkit"on my pc,,but the problem (asking for "Strip path extension__ogtk.vi", )is still there,
the install package only contain labview6.X and labview 7.0,,
any idea what it is?
05-10-2010 11:15 AM
Hi,
I'm guessing from the name that you are just stripping a portion of the file path from the original one, so that you don't overwrite the TDMS file. This VI doesn't seem to effect the overall functionality of the program; I'd try replacing it with the Strip Path VI found on the File I/O palette.
06-01-2010 05:26 PM - edited 06-01-2010 05:36 PM
Yeah sorry forgot that I used that OpenG VI, attached is another version which doesn't use it for those of you not on the OpenG bandwagon.
I've been using this VI for a little while now and it's worked great on several machines. But recently I've started to see problems where I get an error 97, LabVIEW: Null Refnum was passed in as input.
This happens for me coming out of the property node ITDMAddin. I probed the reference going in and its value is 0, with the variant data also of value 0. Any ideas on how this could happen or what can be done.
I changed the COMAddIn propety node from Object to Description and the string is "National Instruments TDM Importer for MS Excel" So that makes me believe that I am getting the reference to the AddIn but for some reason the Object property returns a value of 0.
EDIT: Okay I think I figured it out, if Open New Instance is TRUE for the Open Automation it works fine. Not sure why but it fixes it, a new version with the fix is up.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
01-26-2011 07:49 AM
really cool, thanks for sharing this!
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
02-02-2011 10:55 AM
Just a note that this could be updated to use the latest TDMS for Excel add on. If you haven't tried it yet, with the latest (not sure what version it started) version of the add on it associates the file extension .TDMS. So all you need to do is perform a system exec on the TDMS file and it will launch Excel and perform an import for you. Then all that's needed is calls to Excel to perform a save on the new work book.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord