LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

add data to an existing file

hi
   i am writing the data in a spreadsheet and using excel to view that data. by the way i am  using labview7.1.
 
But my problem is that i cannot let the program run always. After collecting a set of values i have to stop it and make it run again later for a desired condition and store the values in a the same file.
 
Is there a way that labview writes the data set taken later in the same file below the data set recorded previously?  i am using a 1d array and writing the array as a row in the spreadsheet. so i want the next set of values to be the next row and not overwrite the previous row.
 
i have attached the code.
 
 
 
 
 
0 Kudos
Message 1 of 8
(4,179 Views)
One easy solution is to use Write To Spreadsheet File.vi like showed below :


Message Edité par JB le 06-22-2007 02:14 PM

0 Kudos
Message 2 of 8
(4,171 Views)
Hi Kunal227,
You can use Write to Spreadsheet File.vi that's under All Functions->File I/O. It looks like you are writing an 1D array of data, so you can wire your data to 1D data terminal.  Also set the append to file? (new file:F) terminal to True.  It should then append to the existing file you specified in the file path. Hope this helps.

Yi Yan
Applications Engineer
www.ni.com/support

Message Edited by Yi Y on 06-25-2007 12:54 PM

0 Kudos
Message 3 of 8
(4,136 Views)
I need to write data to a cell in an existing excel file using labview only. PLease help
0 Kudos
Message 4 of 8
(4,094 Views)

actually you can try the idea mentioned in the message above yours

0 Kudos
Message 5 of 8
(4,085 Views)
To write to a single cell in an existing Excel spreadsheet (as opposed to a a line or row in a text file), you should look at the shipping example called Write Table to Excel. While the example writes a 2D array to Excel, there are subVIs that should help explain how to get a reference to a worksheet and specify a cell for a write.
0 Kudos
Message 6 of 8
(4,084 Views)
Thanks guys...
but since I am a new user, I am still facing a small problem. I tried to replace the Open New Workbook.vi by Open Specific Workbook.vi   and though I am sure I am pretty close, it still doesnt work.
I just wired the connections similar and gave the pathname as a string...God knows why it aint compiling. Can anyone just make this modification and upload th file....Would be really helpful
0 Kudos
Message 7 of 8
(4,066 Views)
Hi Tayal,
I tried replacing Open New Workbook.vi with Open Specific Workbook.vi, and it seems to work normally if you have an existing Excel file.  The vi uses ActiveX and opens up Excel when it runs.  So make sure you have Excel properly installed.  I attached the VI.  Hope this helps.

Yi Y.
Applications Engineer
http://www.ni.com/support
0 Kudos
Message 8 of 8
(4,004 Views)