ni.com is currently experiencing unexpected issues.

Some services may be unavailable at this time.

取消
显示结果 
搜索替代 
您的意思是: 

Labview to Excel

已解决!
转到解答

Hello, kinda new to Labview. Is there a way to send your data from Labview to Excel from multiple runs and have it all on one excel sheet? Right now I have my program working and I get my data. I know how to sent it to excel, but I need to send it to the same excel sheet from multiple runs. It involves changing some of the settings and recording new data, that's why I need to stop and run multiple times.

0 项奖励
1 条消息(共 8 条)
4,871 次查看
解答
接受人 Ivan.G

Well without seeing any of your code I would suggest using the "Write to Delimited Spreadsheet" vi and make sure you wire a True boolean constant the "append to file? (new file:F)" input.

 

qqqCapture.PNG

Appending will add new data to the end of the file, the default is to create a new file every time.

========================
=== Engineer Ambiguously ===
========================
0 项奖励
2 条消息(共 8 条)
4,858 次查看

When you say you want to save your data to Excel, do you mean that you want to write a (proprietary) .xls or .xlsx file, or you want to write a Text file with commas (or Tabs) separating "columns" and lines of text constituting rows, what is called a "Comma-Separated Values" (or .csv) file?  Excel can open both types of files, but only the .xls/xlsx format should be called "Excel files".

 

 

LabVIEW provides "Spreadsheet" functions in the File I/O Palette to read and write .csv files.  To actually write true Excel files, you need either LabVIEW's Report Generation Toolkit or third-party routines that use ActiveX to link into Excel.  Both (I believe) require that Microsoft Excel be installed on your PC.

 

For the Spreadsheet Functions, the Help documentation for the Read and Write functions and the Examples that ship with LabVIEW should get you started.  There are also examples for the Report Generation Toolkit, including a "Revised" one I wrote several (2014?) years ago (search for "Revised", with Quotation marks, in this Forum).

 

Bob Schor

0 项奖励
3 条消息(共 8 条)
4,822 次查看

Sorry about the late reply. This code is for radio receiving. Most of it is changing settings on the RMA 180 (radio test set) and then finally getting the data I need (SINAD)Code.PNG

0 项奖励
4 条消息(共 8 条)
4,785 次查看

Dear Ivan,

I would recommend that you run your wires a little neater. For instance it looks like RF Frequency and Level run into the same input, which is impossible, because it would break the wire. 

 

Back to RTSLVU's question, do you need and Excel file (.xlsx) or is a delimited text file just as good? (You can still open it in Excel and it will look like a nice spreadsheet). I always go for the plain text files because they are much easier to work with later on.

 

Now the real question (or observation) is that your code currently does not create any data files, unless it is being done in secret by one of those instrument drivers. I assume you're right clicking your array and exporting to Excel. If you really need Excel files, you should use the Report Generation Toolkit which has a little learning curve. If a plain spreadsheet file will do, then you should use Write Delimited Spreadsheet which defaults to tab delimited, but you could change it to a comma or something else if you desire. RTSLVU has already shown you to set the "append" flat to True.

0 项奖励
5 条消息(共 8 条)
4,776 次查看

Okay gotcha. As of right now, I am just looking at the displayed results and recording them my self, since I was unable to figure out how to do multiple runs and record data. I would want it in .xlsx so I can edit it using excel (averaging, etc.). 

 

Will check it out how to use Write Delimited Spreadsheet. Thank you.

0 项奖励
6 条消息(共 8 条)
4,746 次查看

@Ivan.G wrote:

 I would want it in .xlsx so I can edit it using excel (averaging, etc.). 

 


You do know that a file does NOT have to be an XLSX for Excel to open it, right?

 

Excel will open and attempt to import any file (regardless of the extension) bringing up the "file importer" and asking you a couple questions on how the file is delimited if it is not a standard Excel file.

 

The "delimiter" for Write to Delimited Spreadsheet.vi defaults to a TAB, just use it that way and put a .TXT extension on your data files. 

 

I used to change the delimiter to a comma and make all my data files a .CSV but really that is just extra work as Excel still runs a .csv file through the importer just like a .txt file, so why bother? Besides a TAB delimited text file can be read with any text editor and your data will line up nicely in columns, unlike a .csv file 

 

========================
=== Engineer Ambiguously ===
========================
0 项奖励
7 条消息(共 8 条)
4,741 次查看

@RTSLVU wrote:

@Ivan.G

You do know that a file does NOT have to be an XLSX for Excel to open it, right?

  


Agreed. Since Excel is usually not the default program for text files, I like to drag the file (from windows explorer) into an Excel window to open it quickly.

0 项奖励
8 条消息(共 8 条)
4,727 次查看