LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Microsoft office report package

Open a new report with the New Report function, wiring Excel in as the Report Type.  You'll need to use the Report Object wire for all the remaining Excel functions, so don't lose it!

 

Add Worksheet if needed (this lets you name the Worksheet).

 

Do you want a Header row?  If so, create an array of strings holding the header entries.  In your case, it could be "Time" and "Data".  Wire this string into Excel Easy Table (passing in the Report Object wire, of course).  Note that you might need to make your 1D "single row" of data into a 2D "Table" of data.

 

Notice one of the outputs of Excel Easy Table is a cluster giving the location of the "next row".  You'll want to use this, wiring it into a shift register in the While Loop that's coming up ...

 

To save your data, create a While Loop (with Shift register for the Current Row) and do the following (within the loop):

  • Get a data point, along with its time.
  • Format Time and Data into an array of strings.
  • Wire this to Easy Table, passing Next Row into the Next Row shift register.
  • Wait 5 minutes (or otherwise "self-clock" this loop).
  • Exit the loop when all the points are collected.

On the "exit" side of the While Loop, do a Save Report to File (wiring in the desired output file name), followed by a Dispose Report, which also marks the end of the Report Object refnum you've been using.

 

See?  I told you it was easy ...

 

BS

0 Kudos
Message 11 of 13
(595 Views)

Hi Bob,

 

Thanks so much for getting back to me on this.

I have made some progress with this solution, the problem I now have is that my Excel Easy Table only has a "next cell bottom-left" and "next cell top-right"  output.

The headers and so on are formatting fine but the Excel table is still only logging one measurement and date and closing then.

I would think the problem now is that I don't have the next "next row" output that is causing this problem.

 

If you have any more suggestions I would be greteful for them.

 

Regards,

Kieran

0 Kudos
Message 12 of 13
(582 Views)

Here is an Easy Excel Demo that carries out the steps I outlined in my last note.  This saves a (random) data point every 5 seconds (you can easily change this to 5 minutes -- I wasn't patient enough).  Note that while it runs, the Workbook will be open in Excel and you can actually see the rows appear.

 

Note -- this Snippet comes from LabVIEW 2012.  I don't know if Snippets are "backwards compatible", but if not, you should easily be able to program this from the "picture".

 

BS

 

Easy Excel Demo.png

Message 13 of 13
(570 Views)