LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview to excel

Solved!
Go to solution

The title of your post is LabVIEW to Excel.  If you want to write to Excel, you should use the Report Generation Toolkit, which is extremely easy to use (there are numerous discussions and examples in the Forums).

 

As a general rule, if you want to (a) learn LabVIEW and (b) use LabVIEW to do anything other than the most trivial demonstration of a simple task, then try to follow these two simple steps:

  • Avoid all Express VIs.  These usually oversimplify what can be done, and "hide" possibilities from the User, making it much more difficult to "untangle" the results.
  • Avoid "Dynamic Data" wires (which are rarely produced or use except by Express VIs).

In particular, this means that to do the Excel writing you mention, you need to use the RGT and the following four functions:

  • New Report, to create the Report Generation Object and link it to Excel.  You do this once, before entering the loop to generate values.
  • Excel Easy Table VI to write data into the Excel Worksheet.  Depending on your needs, i.e. if you want to write all of the rows (and a single header) at once when they are all generated, or write just the Header, then each row, one at a time, as it is generated, you will place this call within the data-genating loop or after it.  [If you want to write one row at a time + have a header row, you can write the header first, before entering the loop].
  • Save Report to File and Dispose Report to save the file as an .xls or .xlsx file and to close Excel.

As I noted, there are numerous examples of code that does this, both in the Forums and in the LabVIEW Help.  I posted a revision of one of the LabVIEW Help Examples here in January, 2014.

 

Bob Schor

0 Kudos
Message 11 of 15
(1,038 Views)

thank you 😄 🙂

0 Kudos
Message 12 of 15
(1,029 Views)

Thank you BOB but I think that the solution with DDT is more easy for a beginner 🙂 

0 Kudos
Message 13 of 15
(1,021 Views)

Hi Ramlus,

 

what's the reason for all that Rube-Goldberg in your code?

 

Why do you need to convert the DDT wire to DBL and immediatly back to DDT?

Why do you need to index the string array - does autoindexing not work for you?

Why do you need to concat a scalar string?

 

I think that the solution with DDT is more easy for a beginner

In the long run you will be better off using NO expressVIs…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 14 of 15
(1,015 Views)

If it works, go for it!  Just remember that the "advanced" methods, in this case, are not so difficult ...

 

BS

0 Kudos
Message 15 of 15
(1,010 Views)