LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I see data being logged in Excel real time?

Solved!
Go to solution

I want to open the excel file while the program is running, but I kept getting an error or the program would stop. How do I see data being logged without having to stop the program? 

See my attached code

GRCK5000_0-1678984991233.png

 

 

0 Kudos
Message 1 of 5
(1,073 Views)

If you open the spreadsheet file in Excel, it will block access to it.

You could probably use the Report Generation Toolkit to log data to a real Excel file (.xlsx), and I think you will have options to show or hide the Excel window.

 

0 Kudos
Message 2 of 5
(1,065 Views)

If you want to use Excel, you'll need to do what Gregory said and use the Report Generation Toolkit, which can interface with Excel using Excel's API.

 

If you just want to see data going into a file, use Notepad++. It doesn't block access to a file when it has it open. It won't update in real time, but you can refresh the view and see changes made to it. The VI you're using saves the spreadsheet file after each write, so Notepad++ will be able to see it. I don't know if it would see unsaved changes to a file.

Message 3 of 5
(1,057 Views)
Solution
Accepted by GRCK5000

Your program never does anything with an Excel file.  You are using the LabVIEW "Write Delimited Spreadsheet" function which writes an "ordinary" Text file using 1D or 2D Arrays of data, separating the "columns" of the Arrays in the text file with (by default) a Horizontal Tab character, and ending each "row" with an End-of-Line (usually <CR><LF).  If the separator character is changed to a Comma, such a Text file is called a "Comma-Separated-Value" file (abbreviated ".csv"), which Microsoft displays with an Icon that "suggests" this is an Excel File.  It is not.

 

The Delimited Spreadsheet File has another unusual "feature" -- every time you call the file, you open it, write to it, and close it.  It is designed that way.  

 

If you were really writing to an Excel File (which you can do by using the Report Generation Toolkit, or third-party software), Excel would stay open and you could watch your data being added.

 

Note that there is nothing to stop you from creating an Array Indicator on your LabVIEW Front Panel and writing to both the Indicator (so you can "see" the data) and to the Delimited Spreadsheet File (so you can "save" the data).

 

Bob Schor

Message 4 of 5
(1,054 Views)

Thanks Mr. Bob Schor for this information and thanks everyone else.

0 Kudos
Message 5 of 5
(992 Views)