LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data Acquisition

Hi all!

 

 

Please help me!! I save all my data in Excel but tha information are too much and I want put information in differents sheet´s in Excel but the same book, I use the  "Write to Measurement File" 

 

 

Thanks

 

 

Greco Aguilar

0 Kudos
Message 1 of 7
(2,466 Views)

Do you have Report Generation Toolkit? If so

 

http://decibel.ni.com/content/docs/DOC-5468

Andy Chang
National Instruments
LabVIEW Control Design and Simulation
0 Kudos
Message 2 of 7
(2,460 Views)

If you don't have the report generation toolkit, you can write to specific worksheets using Automation and property nodes.  For example, below is a code snippet showing how to open excel, open a workbook, open a sheet in a workbook, then write to a cell on a sheet.  It's kind of long, and in the real world it would be broken down into specific subVIs, but you get the idea.

 

Sample excel sheet control.png 

-------------------
Greg
Certifed LabVIEW Developer
0 Kudos
Message 3 of 7
(2,438 Views)

Thanks Andy and RGreg. I have question, is possible storage data with yours recommendations in different sheet in same time, I mean, I have approximately 100 data's to storage, and I try to record 50 data in the sheet 1 and same time, record en the same book the rest data, that are 50 data en the sheet 2 

0 Kudos
Message 4 of 7
(2,398 Views)

Sorry I didn't respond sooner - I had a nasty flu bug the last couple days.

 

Yes, you can write to multiple sheets within the same workbook.  Using the code snippet I provided before, I suppose you could open separate sheets and write data to those sheets simultaneously, though I've never done that myself.

  

As a final note: using spreadsheets to store data only works for so long.  From personal experience I know that eventually things will get confusing - you'll start to wonder what file was updated when, by who, and why. And then someone will go and delete a file by mistake.  At some point you need to look into using a database-type solution...

-------------------
Greg
Certifed LabVIEW Developer
0 Kudos
Message 5 of 7
(2,350 Views)

RGreg: 

 

Your code snippet is intriguing and I could find it quite handy for long term data collection.

 

Normally I would create new spreadsheet file every day and then manually put them into an Excel workbook as separate sheets.

 

If I could get Labview to do this for me, as your code seems to do, it would make life easier for me.

 

When I run this it works as described but it leaves Excel open and the file unsaved.

 

How would I make this so it runs Excel hidden, saves the file, and closes Excel?

 

Or I am thinking it might be better to leave Excel and the file open, but hidden during the duration of a test.

 

But that still leaves the need to save the file and close Excel on exit and at regular intervals to prevent data loss in the case of a crash or power loss. 

Message Edited by RTSLVU on 03-24-2010 08:01 AM
========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 6 of 7
(2,340 Views)

Well, if you play with the code snippet you'll notice that there's an option to make it visible or not when you open it.  You can shift that to FALSE, but be careful - you could end up with multiple copies of Excel running and not know it.

 

To save and/or close the file, use the appropriate Workbook methods ("Save", "Save As" or "Close").

 

Of course, if you have the Report Generation Toolkit try using that instead.  I've found that in most cases it handles Excel pretty well. 

-------------------
Greg
Certifed LabVIEW Developer
0 Kudos
Message 7 of 7
(2,311 Views)