Jump to content

Logging data to excel


Recommended Posts

QUOTE(CTITech @ Jan 31 2008, 12:21 PM)

im pretty new to labview 8.5 and im trying to take some low voltage i/o inputs and log the data in excel, sad to say its not goin to well. Any help would be great.

Can you show us what you've done so far? Are you writing to a .csv file or a .xls file? The .csv format is much easier to deal with (not to mention faster) in LabVIEW. Check out Write to Spreadsheet File.vi located on the file I/O pallette.

Link to comment
  • 3 weeks later...

Yea I got that to work. Im collecting all the data in my loop and I got it setup so it gives me the min/max voltage per channel and sends it to my excel folder. I cant figure out how to get a label along with the voltages though. Im just getting my voltages dumped into excel. So I have 2 questions. 1. How to I label these voltages, and 2. Is there a way I can tell the voltages what row and colunm to be dropped it?

Link to comment

QUOTE(CTITech @ Feb 20 2008, 04:38 AM)

Well you can download and use the library (it's free) . But if your rules at work don't allow for that sort of thing, you can build the functionality from the ground up. That's what Martin Vernhout of Philips Research did when he put the library together in the first place. But you'll need a good understanding of the internals of Excel and how to access them through Method & Property nodes with ActiveX.

This is an example of his subVI to write an array of text values to a specified set of locations on a selected worksheet:

http://lavag.org/old_files/monthly_02_2008/post-2800-1203521435.png' target="_blank">post-2800-1203521435.png?width=400

In it you can see the Worksheet method and the Range property node used to transfer the string arrays to the Excel process.

I've attached the help files associated with the library for your consideration.

So far, the only thing about the library I've found so far that I don't care for is that the lowest-level "excel objectRepository" vi has a locked block diagram, but that doesn't keep it from being perfectly usable and a great help to have. Besides using the library to read and write native .XLS files, I've used it as a learning tool and have expanded on it to the point where I can even create graphs on the Excel worksheets with it.

I, for one, am grateful Martin chose to share this with the rest of us.

Try it, you'll like it!

Link to comment

QUOTE(CTITech @ Feb 21 2008, 11:15 AM)

Ok. I have a string of concatenate and i need to get it to go into a write to spread sheet vi. Since Im new to this whole thing I could just be over looking something extremly easy

I suspect you do need to put a bit more effort into learning this on your own before saying you need help.

The library ships with examples and Example #1 shows a situation where the "Write Strings" vi is used to write strings to a spreadsheet. The strings to be written by way of this vi do have to be in an array to make the connection to the vi, but you do know that arrays can have only one element don't you? You just might be forced to pass your string through the build-array function before connecting up to the vi.

Link to comment
  • 1 month later...

Instead of worrying about writing to Excel, perhaps you could just figure out how to make a CSV file and import it into Excel later. CSV's are easy: send out your data separated by commas, and add a linefeed at the end of each line of data. Super simple and Excel is totally happy with it.

Link to comment
  • 2 months later...

QUOTE (Lars915 @ Apr 3 2008, 02:56 PM)

Instead of worrying about writing to Excel, perhaps you could just figure out how to make a CSV file and import it into Excel later. CSV's are easy: send out your data separated by commas, and add a linefeed at the end of each line of data. Super simple and Excel is totally happy with it.

I totally agree with this advice. It is much easier and faster to work with a 2D array than to work directly with Excel. On some of the larger projects I have worked on we have run into performance issues and race conditions (inside Excel, not LabVIEW). We found it was better to work with a simple CSV file. In some cases where native Excel was required we only wrote the Excel file at the completion of the application using the temporary CSV file as the input.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.