LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Waveform array to text

Ok, fun for a Friday afternoon!

 

I have an automated test where I need to produce an excel report that gets saved as a PDF and printed.  There are currently 4 charts that need to go into the report and I have the history data for each chart going to a separate sheet in excel and sheet 1 has the actual report.  I was having issues getting graphs into excel with the report toolkit, so I decided to format them in excel and look at the different sheets for the data.

 

I could make a VI that would handle each waveform separately, but I wanted to handle them all in one vi.

 

Problem:

 

After running the vi (2011 snippet) looking at the all data array indicator (3d)

 

Page 0 - I only get a time header, the time is wrong but the other data is correct

Page 1 - Same as 0

Page 2 - all the data is ok and I only get the time header

Page 3 - all headers are ok, the time data is bad and the rest of the data is ok

 

So I am looking for help to get the correct information for each waveform.  I have been playing with this for a day or so and figured I would ask for some help.  I imagine I messed up an index somewhere....

0 Kudos
Message 1 of 8
(3,714 Views)

What you are trying to do sounds certainly do-able in LabVIEW, particularly with the RGT.  Could you attach an example Excel file that shows what the data look like?  If you could also make (on the same or another Sheet) an example of the appearance of the corresponding Excel graph, that would save us a lot of potentially wasted time.

 

Bob Schor

0 Kudos
Message 2 of 8
(3,693 Views)

There is a vi called Export Waveforms To Spreadsheet File.vi from the Waveform -> Waveform File I/O palette. Have a look at its block diagram, you could copy it to a new vi and remove the write to file part and the Array to Spreadsheet string conversion. You would have a 2D string array output. Use the array functions and the RGT vis to save to Excel in the format that you want.

 

Ben64

0 Kudos
Message 3 of 8
(3,681 Views)

Out of curiosity, if the end report is a PDF why use Excel at all?  There is a good PDF report toolkit (https://decibel.ni.com/content/docs/DOC-10952) that would let you just generate the PDF directly.

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

@BowenM wrote:

Out of curiosity, if the end report is a PDF why use Excel at all?  There is a good PDF report toolkit (https://decibel.ni.com/content/docs/DOC-10952) that would let you just generate the PDF directly.


Corrected link: https://decibel.ni.com/content/docs/DOC-10952 (final ")" removed)

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

@Bob_Schor wrote:

What you are trying to do sounds certainly do-able in LabVIEW, particularly with the RGT.  Could you attach an example Excel file that shows what the data look like?  If you could also make (on the same or another Sheet) an example of the appearance of the corresponding Excel graph, that would save us a lot of potentially wasted time.

 

Bob Schor



Here is an example excel file, the data is on sheets 2-5.  Sheet one is the report I am working on with graphs.  One of the graphs has a secondary scale that I was having problems with RGT.  If you look at sheet 5 the headers worked but the time column is wrong.

 

So I can get the data to excel, the problem is that when I am indexing the waveform arrays I am messing up the headers and time columns.

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

@ben64 wrote:

There is a vi called Export Waveforms To Spreadsheet File.vi from the Waveform -> Waveform File I/O palette. Have a look at its block diagram, you could copy it to a new vi and remove the write to file part and the Array to Spreadsheet string conversion. You would have a 2D string array output. Use the array functions and the RGT vis to save to Excel in the format that you want.

 

Ben64



I had no idea that was there.  I will take a look.

 

Thanks

0 Kudos
Message 7 of 8
(3,644 Views)

@BowenM wrote:

Out of curiosity, if the end report is a PDF why use Excel at all?  There is a good PDF report toolkit (https://decibel.ni.com/content/docs/DOC-10952) that would let you just generate the PDF directly.


I can take a look at that. 

 

I currently use named cells in excel to arrange (setup) test reports.  My IT department freaked out when I installed CutePDF(?) and they said it could be done from excel.  They said free pdf software was evil for some reason.  But if this can all be done within LabVIEW it could work out well.  I just have to figure out how to make reports with the RGT.

0 Kudos
Message 8 of 8
(3,626 Views)