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.
08-17-2011 02:39 PM - edited 08-17-2011 02:41 PM
1. How can I add a header in write spreadsheet file.vi? (At the moment, it only stores a number of columes of data with each colume representing one channel. I want to put a header at the top indicating the names of the channels).
2. Can I store the date and time, at which each point of data is logged, together with the data themselves in one file?
Solved! Go to Solution.
08-17-2011 03:03 PM
You can open the "Write To Spreadsheet File.vi", modify it with a header input that works to your liking, and save it as another name (don't overwrite the original). Adding another Array to Spreadsheet String VI, a string concatination, and an array of strings input for your headers is all that is needed.
As for saving the actual time for each data point you would need to track that with your data and add it along with the rest of your 2d data. The Write To Spreadsheet File.vi doesn't have this feature built in.
Alternatively, I recommend you do the following:
1. Be sure to use the Waveform output on any kind of data read operation if it is available. Familiarize yourself with this complex data type that NI has come up with as it will really save you a lot of headaches and extra coding. If the VI that is doing your data reading does not support the Waveform data type, then you can always convert the data to a waveform.
2. Try using the Write Measurement File Express VI. You will probably have more luck with that then the write to spreadsheet vi.
08-17-2011 03:06 PM - edited 08-17-2011 03:14 PM
Do you have there Report Generation toolkit? If so, there are Excel specific functions for modifying the spreadsheet. Attached is a VI that may help.
Yes, to number two. Store the data/time in your 2D array along with your data, preferably on the same row.
08-17-2011 04:09 PM
nothing wrong with format into file. works just like scan into string. When you create your file just write a single line for the header information.
What format is your "spreadsheet" in? and what to you open it with to view? this is a handy vi to re-format a LabVIEW timestamp into a date/time format used by Excel and Lotus.