01-11-2013 10:29 AM
Of course you can use the Write to Spreadsheet File to write a header. It can be set for string input with a simple right click>Select Type. Either call it twice where the first use is to write the header and the second is to write the data or call it once where you convert the data to strings.
01-11-2013 10:42 AM - edited 01-11-2013 10:42 AM
Thank you for the reply. I couldn't get it to work before because I was writing to the "2D" of the Write to Spreadsheet File VI and didn't have an array but I got it to work now, :D.
I do have one more question about this. Which is better: Write to Spreadsheet File or Write to Text File? I'm not planning on taking over 600 measurements BUT this program could be used to take a lot of measurements in the future, possibly 1000's, so I want the ability to do that.
01-11-2013 11:13 AM
Write to Spreadsheet File calls Write to Text File and does the formatting. If you don't call Write to Spreadsheet in a loop, there is really no difference. Write to Spreadsheet opens the file and then closes it so there is a bit more overhead when this is called repeatedly. With Write to Text File, you can control when to open and close the file.
01-11-2013 11:26 AM
akhurash wrote:I do have one more question about this. Which is better: Write to Spreadsheet File or Write to Text File? I'm not planning on taking over 600 measurements BUT this program could be used to take a lot of measurements in the future, possibly 1000's, so I want the ability to do that.
General hint: When you see one of the white VIs on a palette that means it's not a primitive (those are that dull yellow color). You can open it up and look inside to see what it's doing and how it's doing it.
01-11-2013 12:00 PM
Thanks. I still can't figure out why when I use the Write to Text File the output is all wierd but the Spreadsheet should work.
01-11-2013 06:47 PM
@akhurash wrote:
Thanks. I still can't figure out why when I use the Write to Text File the output is all wierd but the Spreadsheet should work.
The term "weird" can mean anything, it has no useful definition here. Please specify what you expect to get and what you get instead. Maybe even attach your VI.
01-16-2013 08:52 AM - edited 01-16-2013 08:52 AM
altenbach, I expected the function to write some measurements (floating numbers) but when I write a lot of measurements (over a 1000) the output weren't floating numbers at all. They were Chinse (Asian) symbols. When I run the file yesterday it was working, the function was writing floating numbers even when I was writing a high number of measurements. I'm not sure why but I guess closing LabVIEW and restarting made it work.
I do have one question. Is there away I can clear the contents of a text file before writing to it? I don't want to append or start writing from position 0, I just want to clear all the contents and then write to it agian.