LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Exporting Data to Excel

Solved!
Go to solution

Hello,

I'm trying to write a program that exports data acquired from a pressure transducer, and a millisecond timestamp continuously to Excel. 

I'm getting the data and timestamp to show up in Excel, but it only updates in the first two cells of the spreadsheet instead of recording new data in new cells going down the spreadsheet, which is what i want the program to do.

Thanks for taking the time to help!

(Written in LabVIEW 2018)

 

P.S. I'm rather new to LabVIEW so please be nice!

0 Kudos
Message 1 of 4
(217 Views)
Solution
Accepted by topic author buddientis

I don't see where you are exporting data to an Excel file.  But I do see where you are using Write Delimited Spreadsheet.  In there, you did not wire the input for Append to File which means it will use its default setting of False, thus overwriting the file each time it is called.

 

Other tips:.

1  Don't use that STOP function (stop sign icon).  It is the same as aborting your VI which means any resources that haven't been closed (files, DAQ tasks, ...) are still left open.

2.  You should start your DAQ tasks before the while loop and close them after.

3.  Having those DAQmx Clear Task VI's outside of the case structures means that they are going to throw errors when the False case is executed since it will use the default value of the task which is an empty reference.

4.  Avoid using "Use Default if Unwired" tunnels except in rare instances.

5.  I don't see any defaults int eh controls for the analog output tasks to know if they are using different devices.  If both analog output channels are on the same device, then they should be 1 task with 2 channels, not 2 separate tasks.

6.  Your pop-up gauge VI's are pointless as all they do is pass the input value through to the output.

7.  Your Write to delimited File, might need to have a True wired to the Transpose Array? input.

Message 2 of 4
(200 Views)
Highlighted

I'm using Write Delimited Spreadsheet to write data to a .csv formatted excel sheet. 

I changed both of the Append to File and the Transpose Array inputs to true and it's working like I wanted it to. Stupid mistake by me.

Also, responding to tips 5 and 6,

5) I'm using two different devices.

6) The pop up VI's were the only solution i could find/come up with to show a gauge on a monitor separate from the one that the front panel is being shown on. 

Your tips are very helpful and I'll keep them in mind! Thanks.

0 Kudos
Message 3 of 4
(188 Views)

@buddientis wrote:

 

6) The pop up VI's were the only solution i could find/come up with to show a gauge on a monitor separate from the one that the front panel is being shown on. 

 


Gotcha.  I didn't dig into any settings.  I guess you have them set to Show when Called or something like that.  There are some other ways like opening a VI reference and opening their front panel.  You might want to investigate them.  But if it is working for you just fine now, then you probably have it set the simplest, easiest way.

0 Kudos
Message 4 of 4
(182 Views)