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: 

Excel channel export

Solved!
Go to solution

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)=CNO("ap "&An_parameter&" "&GraphName&" X L")
            ExcelExpChn(2)=CNO("ap "&An_parameter&" "&GraphName&" Y L")

 

 

 

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!

 

 

0 Kudos
Message 1 of 8
(4,431 Views)
Solution
Accepted by topic author s.g.m.

Hello s.g.m.,

 

I initialized one variable in addition.

 

ExcelExpSheetChn = "DIAdem"

and it worked with my DIAdem 2010.

 

Greetings

Walter

0 Kudos
Message 2 of 8
(4,426 Views)

ooOOOH THANK YOU!

0 Kudos
Message 3 of 8
(4,421 Views)

Is this method compatible with DIAdem 2017?  If so, does anyone have a working script for exporting one channel to an Excel spreadsheet?

0 Kudos
Message 4 of 8
(3,061 Views)

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

0 Kudos
Message 5 of 8
(3,055 Views)

Works great, thanks Brad!

Chris

0 Kudos
Message 6 of 8
(3,038 Views)

For some reason this stopped working for me.  Instead of getting a bunch of nice Excel spreadsheets, I'm getting this error

 

ExcelExportError_171213.png

 

 

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"

 

RootNameChangeError_171213.PNG

0 Kudos
Message 7 of 8
(2,970 Views)

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.

0 Kudos
Message 8 of 8
(2,965 Views)