DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Export all Channels to Excel without a dialog or a stp file

Hello,
 
i try to write a vbs script that export all channels that exists to excel without a dialog. By the reson that i don´t know exactly how many channels are generated while the measurement i can´t use a stp file. I tried to set all variables but everytime i get a global error (excelstat=100).   
Since this problem was discussed  in 2006 ( http://forums.ni.com/ni/board/message?board.id=60&message.id=2115&query.id=95137#M2115)  perhabs there is a solution now with Diadem 10.2, besides generate the stp file in the script or hold stp files for any possible number of channels.
 
 
Thanks for the help
diademi


Message Edited by diademi on 04-24-2008 10:10 AM
0 Kudos
Message 1 of 5
(4,425 Views)

Hi diademi,

Nothing has changed in DIAdem since then, but you do have several options.  First and foremost, you can save the data as a TDM file and use the freely downloadable TDM Excel Add-in to load the TDM file into Excel.  This has the advantage that it's extremely fast but the disadvantage that it's completely inflexible as to where and how the written values show up in Excel.

http://zone.ni.com/devzone/cda/tut/p/id/4906

If that doesn't work for you, you can export the data channels into an ASCII file, as mentioned in the older link.  This has the advantage that it's fast but the disadvantage that it's not very flexible as to where and how the written values show up in Excel.

Finally, you can export your data channels into an Excel file using ActiveX calls in a DIAdem VBScript.  This has the advantage that it's flexible in where and how you write the values, but the disadvantage that it's comparatively slow, especially for large data sets.

Let me know what sounds most promising, and I'll send you code.  Also, please confirm whether you're using Excell 2007 or an earlier version.

Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 2 of 5
(4,390 Views)
Hi Brad,
 
thank you for your answer. I already tried the OLE Connection to Excel, but this is to slow. I have to wait 5 minutes to export ten channels with 6000 mesuring points, too hard to sell. I thing i will try the asci-export or edit the stp file out of the script. Do you know where i can get a stp-file description?
 
Thanks
 
diademi
 
0 Kudos
Message 3 of 5
(4,368 Views)

Hi diademi,

I know that it is possible to manipulate an STP file, but I do not know of any place where it is documented, and I do not recommend that as an approach.  Give the below-attached example application a try-- this uses the CSV Exporter of DIAdem and tricks it into adding a global header and column headers.  The performance should be excellent, the only drawback is that the header content is passed through the DIAdem channel naming filter, so for example all "/" characters get changed to "\" characters.

Let me know what you think,
Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 4 of 5
(4,342 Views)

Hi Brad,

i tinkered me a little workaround. I made an stp file for 30 channels, that is the maximum number of channels that were produced while measurement, i guess ;-). Adding dummy channels as needed, making the excel-export and after that i use a OLE Connection to delete the dummy channels again. Not beautyful but it does what it should with one additional stp file and in time.

Thanks for your help!

diademi    

0 Kudos
Message 5 of 5
(4,335 Views)