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.
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.
09-23-2010 02:49 AM - edited 09-23-2010 02:50 AM
I have a problem with single channel export. I want to export two or three channels but without wizard and without configure file stp. I try to do:
EXCELChnCount=2
ExcelExpChn(1)=1
ExcelExpChn(2)=2
Call EXCELExport (FileDlgFileName,"",0,"")
The file doesn't export and I have the error 100 "a general error has ocurred..." But If I do 1 export with wizard and afer I do it without wizard the file exports correctly all the time.
What is the problem???
IF is not possible to do the export in this way there are some alternative?
Thanks!
Solved! Go to Solution.
09-23-2010 03:41 AM
Hello s.g.m.,
I initialized one variable in addition.
ExcelExpSheetChn = "DIAdem"
and it worked with my DIAdem 2010.
Greetings
Walter
09-23-2010 03:48 AM
ooOOOH THANK YOU!
09-20-2017 04:49 PM
Is this method compatible with DIAdem 2017? If so, does anyone have a working script for exporting one channel to an Excel spreadsheet?
09-21-2017 06:06 PM
Hi Chris,
No, the old Excel Output Wizard was deprecated years ago. However, you're asking about the right DIAdem version, because the new ExcelTdmExport functionality just released with DIAdem 2017. Here's how to export the "Time" channel from the first group in the Data Portal to a new XLSX file:
Call DataFileSaveSel(ExcelFilePath, "ExcelTdmExport", "[1]/Time")
Brad Turpin
DIAdem Product Support Engineer
National Instruments
09-25-2017 01:02 AM
Works great, thanks Brad!
Chris
12-13-2017 01:13 PM - edited 12-13-2017 01:36 PM
For some reason this stopped working for me. Instead of getting a bunch of nice Excel spreadsheets, I'm getting this error
This is my code:
Dim oTBGrpColl, iElement, sFileOut
const sBasePath = "N:\TeamShares\Data\Software\DIAdem\DIAdem Scripts\NVH\Reports (Default)" 'output location
Set oTBGrpColl = Data.GetChannelGroups("TB_ACCL*")
For iElement = 1 To (oTBGrpColl.Count/2)
Call ExportExcelFile(oTBGrpColl(iElement)) 'export one torque trace from each of the two groups (runs) with the same tag
Next 'iElement
Sub ExportExcelFile(oGrp) 'Not the same sub as "ExportExcelFile" in "MakeNVHContourPlots.VBS"
Dim oMyChnList, oGrpColl, i
Set oGrpColl = Data.GetChannelGroups("*_tag_" & str(oGrp.Properties("Data_Tag_Num").Value)) 'Returns all groups with same Tag as oGrp
Set oMyChnList = Data.GetChannels("[1]/Channel*")
Call oMyChnList.Add(oGrpColl(1).Channels("HS_TRQ_DRVLN_cyc_1"))
Call oMyChnList.Add(oGrpColl(2).Channels("HS_TRQ_DRVLN_cyc_1"))
sFileOut = sBasePath & "\" & Data.Root.Name & "_tag_" & str(oGrp.Properties("Data_Tag_Num").Value) & ".xlsx"
' For Each oListElement in oGrpColl
' MsgBox(oListElement.Name)
' Next 'oListElement
' For i = 1 To oMyChnList.Count
' MsgBox(oGrpColl(i).Name & "/" & oMyChnList(i).Name)
' Next 'oListElement
Call DataFileSaveSel(sFileOut, "ExcelTdmExport", oMyChnList)
End Sub 'ExportExcelFile()
I should add that before throwing the error, the code renames the root from "170914d_TC2" to "170914d_TC2_tag_5.00"
12-13-2017 04:43 PM
This works fine if I replace "ExcelTdmExport" with "LVM". Good enough for now, but would like to know why it stopped working or if anyone else has experienced similar behavior.