From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
05-15-2013 05:42 AM
An extension of these questions:
http://forums.ni.com/t5/LabVIEW/Write-to-spreadsheet-file-append/td-p/1166189
I followed their advice and was able to append the data from next iterations into new columns in a spreadsheet file. However, as described in this example program (http://zone.ni.com/devzone/cda/epd/p/id/5345), the "Write to Spreadsheet File.vi" and "Read to Spreadsheet file.vi" takes up alot of resources in While loops and after many interations in my program, it begins to interfere with the speed of data aquisition.
When I replaced the "Write to Spreadsheet File.vi" with the "Write to Text File" function (along with the additioanal components to get it to work) I saw a huge reduction in resource usage. Unfortunately I lost the ability to append new data via columns in a spreadsheet file.
The above links point to the fact that the data must be read and then converted into an array in which new data can be appended. This new array is then written to a text file with the new data showing up as an additional column. I am trying to find some way to maintain the "Write to Text File" function yet add the capability to read from spreadsheet files that is least resource intensive. Are there any ideas? Thank you in advance.
05-15-2013 08:46 AM
Hello madambaf,
I have to admit, I didn't read all of the posts that you linked to, but as I understand, you want to write text data to a CSV- file and want to append data column- wise. The right way ist described from tbob here, but what about saving your csv- data transposed. There you can append new data as a new row, you only have to transpose it once when opening the csv- file. And if you need the file opened in Excel and it interferes with the limitation to only 256 columns, you write your tool to transpose the csv- file before opening it with excel.
05-16-2013 03:39 PM
Hi daveTW,
Your correct that I want to write text data to a CSV-file and then append new data column-wise. I rewrote my question below, a well as my approaches, to include the essential parts that I took from the various other posts I linked too to provided an easier time for individuals to help with my question. Can you please check below to see if you understood my question correctly though I believe you have.
I never actually considered doing the transposition all at once after the program had completed its task and build the final array. This is due to the fact that I initilaly thought the program would have to keep the entire array in memory in order to transpose the rows to columns at the end and hence store unnecessary information. However I see no reason why this has to be the case and I will attempt this approach. Thank you for the help.
My question consists of two parts:
"Are you actually writing to an Excel Spreadsheet? Or are you using the Write to Spreadsheet file function which does not write to an Excel spreadsheet, but creates a text file that Excel is able to open?
I'm going to assume the latter. There is no way to just "append" a column to it. You will need to read the whole file, append the column to the array, and write out the whole file column overwriting the previous file."
05-19-2013 08:50 PM
Hi,
You mentioned in your first post that you were able to append the columns in the spreadsheet however it was taking up a lot of resources. To avoid adversely affecting the data acquisition loop you can use a consumer / producer architecture as show in the example here. Your data acquisition will be done in the producer loop and the append to spreadsheet file will be performed in the consumer loop.
Regards,
05-21-2013 06:33 AM
Hello madambaf,
I made a quick example of what I meant.