11-19-2008 09:28 AM
I have some calibration data from an experiment. There are 14 channels and the data is arranged in a spreadsheet 14 rows x 4 columns, where each column is a different constant from a best-fit equation of the form y = b1 + b2.x1 + b3.x2 + b4.x1.x2, per channel.
I need to get the data into labview so that I can use it during an experiment. Can anyone recommend the best way to do this? I've tried the 'read from spreadsheet file.vi' but can't get it to work. Any recommendations or example code? Or do you think it is better to use a text file?
Thanks
Dave
Solved! Go to Solution.
11-19-2008 09:38 AM
Hi Dave,
why does the "Read From Spreadsheet File.vi" not work? Where do you have problems?
You have to set your used delimiter.
Mike
11-19-2008 09:42 AM
Dave,
Exactly what did not work? Spreadsheet files may be tab or comma delimited text files or in some proprietary format such as .xls. How is your file formatted?
How is the data generated? Is it from a LV program or from some other program? If LV generates it, either the Config file VIs or the read from spreadsheet VIs should work. If it is in some other format, then you need to find a way to read that format.
Lynn
11-19-2008 09:46 AM
11-19-2008 09:49 AM
11-19-2008 09:52 AM
11-19-2008 09:57 AM
The context help does say "Reads a specified number of lines or rows from a numeric text file..."
Its the fine print which get you.
The real problem is that too often the equation "spreadsheet = Excel" is assumed to be true.
Lynn
11-19-2008 09:58 AM
11-19-2008 09:58 AM
They do. From the Help file:
Reads a specified number of lines or rows from a numeric text file beginning at a specified character ... can use this VI to read a spreadsheet file saved in text format.
Note: The underlining is my emphasis. Still, I understand what you're saying, and as I said, it's been poorly named from the beginning.
11-19-2008 10:01 AM
oilyfingers wrote:
so....going back to my original question: what method do you recommend? a text file (CSV or tab delimited)
It doesn't matter. You just need to wire the correct separator character to the delimiter input of the function. It defaults to a tab, so if you save the file as CSV, then wire a string constant to that input with the string constant set to a comma.