From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
06-22-2010 12:52 PM
I'm trying to get the output from a machine, output it to a spreadsheet, and potentially have it graph the data in Excel.
My code and the resulting spreadsheet are attached.
I want the data to be vertical, with all the data being in Columns A and B as opposed to being in Rows 1 and 2
i also want to add Column titles for Voltage and Current.
If possible, I would also like to be able to graph the data automatically.
I am running Labview 7.1.
Thank you
06-22-2010 01:03 PM
Play with the Transpose Input of the Write To Spreadsheet File VI.
06-22-2010 01:19 PM
Thanks, that switched my rows/columns.
Now I just have to add the column titles and see if its possible to automatically graph the data.
Any suggestions?
06-22-2010 01:35 PM
Use Write Characters to File to write your column labels. Wire the Path Out from that VI to the Write Spreadsheet file and set Append to true.
As for Graphing, someone who actually uses Excel would have to help there. I would check out the examples or check out this thread for Excel questions (NO POSTING, JUST READING).
http://forums.ni.com/t5/BreakPoint/Excel-Board/m-p/379682
06-22-2010 01:36 PM
If you were running a newer version of LabVIEW I'd say the following: just call the Write to Spreadsheet File and pass it a 1D array of strings that are your column headers. When writing the actual data with the 2D array make sure you have the "append" set to true.
Since you're running LabVIEW 7.1, the Write to Spreadsheet File VI is not polymorphic. So, you have 2 choices:
If possible, I would also like to be able to graph the data automatically.
Your images shows a graph terminal, so I don't understand this question.
06-22-2010 02:19 PM
This post seems like it would have been helpful, but the code is for Labview 2009, and I only have Labview 7.1
http://forums.ni.com/t5/LabVIEW/Running-a-Excel-macro-from-a-open-workbook/m-p/1023514?jump=true
I have written a macro for Excel to draw the graph, I just have to be able to have Labview run it after it outputs the data.
I want to output an excel file with all the data and a graph of the data in it.
06-22-2010 02:23 PM
Oh, and if possible, I'd like Labview to store the macro (not the xls file) so that this is more platform independent, and the user doesn't have to deal with installing the macro
06-22-2010 02:45 PM
If you need to work with actual Excel workbooks, then you can't use Write to Spreadsheet File. That creates text files, not Excel workbooks. Excel workbooks are a proprietary format, and you need to use ActiveX to manipulate Excel. There are examples that ship with LabVIEW on how to use ActiveX, including a couple of examples on using it to control Excel. Open the Example Finder (Help -> Find Examples) and search for Excel. Also, as Darin indicated, look at the many links in the Excel thread that point to other examples. As noted, do not post question in that thread.
06-22-2010 03:31 PM - edited 06-22-2010 03:32 PM
Thanks, I thought I was hitting a roadblock like that after I ran a macro on a text file I'd renamed as .xls and it asked me to resave in excel format.
I'll try looking through some of the examples and come back here if I need more help.
Thanks again
06-22-2010 05:41 PM
Alright, I'm having major issues trying to figure out the activex stuff to get it working. Does anyone know of a good activex/labview tutorial? An excel specific one would be amazing.