LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write to spreadsheet without prompting each time through a loop

Solved!
Go to solution

So my goal is to take measurements every 5 minutes (or whatever the time delay is, currently 15 seconds until it is ready to use) for several days. My biggest issue is that it asks me after each run where to save to. Is there an easy fix so that once a location is chosen I would be able to walk away and just let it keep running for days and it would keep appending data into that file after each delay?

 

My other thought was data logging. The issue I get with trying to log the data is having it be usable. When I choose a blank excel file to log into I get "The data in the VI's log file is incompatible with the VI's front panel." Why is this incompatibile if I have it going ot a spreadsheet that can be saved as a .xls? Any help or suggestions would be appreciated. I attached my program that I have set up. I understand you dont have the Keithley device so you can't run it, but any help would still be greatly appreciated.

0 Kudos
Message 1 of 34
(5,226 Views)

@Dan Stewart wrote:

Is there an easy fix so that once a location is chosen I would be able to walk away and just let it keep running for days and it would keep appending data into that file after each delay?


Connect the new path output back to the path input via a globally initialized feedback node.

0 Kudos
Message 2 of 34
(5,222 Views)

@Dan Stewart wrote:

My other thought was data logging. The issue I get with trying to log the data is having it be usable. When I choose a blank excel file to log into I get "The data in the VI's log file is incompatible with the VI's front panel." Why is this incompatibile if I have it going ot a spreadsheet that can be saved as a .xls?


 

I don't quite understand what you are saying here. What do you do exactly to get that error message? Is the file still open (and locked) by excel?

 

A spreadsheet in LabVIEW is by default an ASCII table with tabs delimiting columns and newlines delimiting rows. It has nothing to do with a *.xls formatted file, which is a proprietary format.

 

 

0 Kudos
Message 3 of 34
(5,218 Views)

@altenbach wrote:

@Dan Stewart wrote:

Is there an easy fix so that once a location is chosen I would be able to walk away and just let it keep running for days and it would keep appending data into that file after each delay?


Connect the new path output back to the path input via a globally initialized feedback node.


What is considered the new path output? I tried attaching the right side of the feedback node to the data as well as the spreadsheet vi. Neither worked. I also tried keeping the left side blank as well as attaching it to the spreadsheet with the right side to the data. I am not familiar with the feedback node and the help section didn't do a ton for helping me. All of the various combinations I have tried connecting the data or write to spreadsheet have all resulted in prompting me for a file each time through the loop still. I attached the most basic thing I tried, but if you would like other combinations I have tried I can re wire and attach those as well.

0 Kudos
Message 4 of 34
(5,211 Views)
Solution
Accepted by topic author Dan Stewart

You simply need to put in the file name control, fill in the path and file name before you start your run

 

Granted this is the simplest approach, and there are more elegant ways...

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 34
(5,209 Views)

@altenbach wrote:

@Dan Stewart wrote:

My other thought was data logging. The issue I get with trying to log the data is having it be usable. When I choose a blank excel file to log into I get "The data in the VI's log file is incompatible with the VI's front panel." Why is this incompatibile if I have it going ot a spreadsheet that can be saved as a .xls?


 

I don't quite understand what you are saying here. What do you do exactly to get that error message? Is the file still open (and locked) by excel?

 

A spreadsheet in LabVIEW is by default an ASCII table with tabs delimiting columns and newlines delimiting rows. It has nothing to do with a *.xls formatted file, which is a proprietary format.

 

 


When it opens the place to save I choose a blank excel file which is saved as a .xls and that is when I get that error I had said. Based on the previous post response, I think that is the better solution than data logging.

0 Kudos
Message 6 of 34
(5,208 Views)

how about this?

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 7 of 34
(5,197 Views)

The first one inside of the loop worked fine. Thanks. I had put that there eariler and still didn't work, so I must have messed the path up earlier. Thanks for the help though. I am still interested in the other method presented using the feedback node and how that is supposed to work ie. how the wiring of the connections should be made for that to work.

0 Kudos
Message 8 of 34
(5,179 Views)

I am guessing either of these would work too, but haven't tried them...

========================
=== Engineer Ambiguously ===
========================
Download All
0 Kudos
Message 9 of 34
(5,173 Views)

I am having a new issue now. I used your file6 method with the feedback node as well as just putting the control and the place to save before starting, and the data is not actually making it to the file. It is that or the excel book is not able to read it. If the file chosen is an .xlsx it just errors when opening the file afterwards and needs repair and the repaired book is empty. If saved as a .xls when it opens it is just an empy book. Any solutions on how to actually get the spreadsheet that it is appending to to show the data or for excel to be able to accept it?

0 Kudos
Message 10 of 34
(5,125 Views)