LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel File

Hello,

 

I am attempting to write all my data to an excel spreadsheet instead of a delimited one. How would I go about doing this? Also, is there an option to be able to view the data as it is logging in excel instead of having to wait for the test to run to open it up? My company wants to be able to read the excel file as it is taking measurements.

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

Hi sam,

 

LabVIEW comes with those RGT functions (ReportGenerationToolkit) to create office file formats. The example library also brings example VIs for those functions…

 


@sambpk wrote:

Also, is there an option to be able to view the data as it is logging in excel instead of having to wait for the test to run to open it up? My company wants to be able to read the excel file as it is taking measurements.


This is a very bad idea of your company. Opening Excel files with a 3rd party tool will block write acces for your own tool. Ever saw those dialogs mentioning something along like "A different user has opened this office file. Do you want to open a copy of the document?"?

When you need concurrent access to your measurement data then you should think about using databases…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(2,009 Views)

Sounds like a cross-post from a thread on LAVA.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 7
(2,008 Views)

@GerdW wrote:

Hi sam,

 

LabVIEW comes with those RGT functions (ReportGenerationToolkit) to create office file formats. The example library also brings example VIs for those functions…

 


@sambpk wrote:

Also, is there an option to be able to view the data as it is logging in excel instead of having to wait for the test to run to open it up? My company wants to be able to read the excel file as it is taking measurements.


This is a very bad idea of your company. Opening Excel files with a 3rd party tool will block write acces for your own tool. Ever saw those dialogs mentioning something along like "A different user has opened this office file. Do you want to open a copy of the document?"?

When you need concurrent access to your measurement data then you should think about using databases…


Hello,

We just want to have excel open while running the labview program so that we can watch the data to make sure it is within band. I figured out how to write to excel, but is there a way to have excel open while taking data?

0 Kudos
Message 4 of 7
(1,962 Views)

Hi sam,

 


@sambpk wrote:
We just want to have excel open while running the labview program so that we can watch the data to make sure it is within band. I figured out how to write to excel, but is there a way to have excel open while taking data?

You can make Excel visible using ActiveX properties/methods…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 7
(1,954 Views)

I haven't used this in about 6-8 years, but we had a study that used Excel to "run" the experiment.  Each row of the main Worksheet had the parameters of the stimulus, and we stored a few result parameters in some of the columns (most of the data was displayed on Charts).  While the Experiment was running, the Excel Worksheet was always visible, and as we finished one run and started the next one, the cursor moved down and showed us the next row for the next Trial.

 

All of this was done with "vanilla" RGT Functions.  I'm going to look, but I don't recall doing any serious ActiveX coding in this study.  Ahh, yes, we did 95% of the work using RGT functions, but we needed a few functions that weren't present (like one to figure out how many columns were used in a particular row)  with ActiveX functions.  So we knew which row to read (if we'd just run the test in Row 10, we incremented the row to 11, used ActiveX to get the column limits, then we read the entire row, parsed it, and used it to generate the stimulus for that test.

 

So at least 8 years ago, you could have Excel open, read (and write) to it, and see the data being read and written.  Of course, we were doing this one test at a time, a test took 10-30 seconds, so we're talking "slow" ...

 

As I recall, most of the experiments were run with this code compiled with LabVIEW 2010, 2012, and 2014.  I would expect that the current RGT would exhibit the same functionality.

 

Bob Schor

0 Kudos
Message 6 of 7
(1,925 Views)

You may want to check out my link:

 

https://forums.ni.com/t5/Example-Code/Export-TAB-spaced-data-to-rows-and-columns-in-Excel-using/ta-p...

 

I have attached an example vi that mimics data collection and calls the Copy to Excel.vi for online adding of data to an Excel worksheet

 

0 Kudos
Message 7 of 7
(1,846 Views)