LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read from Spreadsheet file


parthabe wrote:

Hi Veeru,

 

There is no other way other than to use ActiveX to read/write Excel files, if you do not have Report Generation toolkit. Smiley Wink


Actually, you can use DDE, or treat the Excel file as a database and use database-related VIs, but that's another story, and not a recommended method. Smiley Wink

Message 11 of 16
(1,321 Views)

Thanks All

 

Still i am not clear how to this task.

 

i tried Rupali answer but i didnt got it correct(i am familiar with activex).I need read all the values(Rows and columns ---upto the where the values was written)

 

Actually i am writing an array of values to the"write to Spreadsheet",it is saved as .xls.Now i want to read the values and plot it in the chart.

 

Please give me some suggestions

 

Thanks

0 Kudos
Message 12 of 16
(1,310 Views)

If you are using the Write to Spreadsheet File function, then all you have to do is use the Read From Spreadsheet File since you are creating a text file - no matter what kind of extension you have. The default settings will read the entire file. The data returned is a 2D array and you can then use the Index Array function to get the rows and columns you want and plot them.

 

If you are struggling with this, you should post an example of one of your files, the VI you have that reads it, and a clear explanation of what data in the file you want plotted and how.

Message 13 of 16
(1,307 Views)

Thanks Dennis

 

I tried your suggestion,but i got a question. How to count how many rows the values were written,

 

I got attached the example i trying to solve.The input to the "write to spreadsheet file is 1D array(say it writes in 10 coulmns). i need to read this values in the excel file and plot all the 10 columns values in the chart

 

Thanks

0 Kudos
Message 14 of 16
(1,300 Views)

Hi Veeru,

 

Do not use the Path to String >> Concatenate function to build the file path. The '\' may be OS dependent. just always use the Build Path primitive from the File IO palette. That way, your code will always be OS independent, I think...

 

Just a thought...

- Partha ( CLD until Oct 2027 🙂 )
Message 15 of 16
(1,293 Views)

Veeru wrote:

Thanks Dennis

 

I tried your suggestion,but i got a question. How to count how many rows the values were written,

 

I got attached the example i trying to solve.The input to the "write to spreadsheet file is 1D array(say it writes in 10 coulmns). i need to read this values in the excel file and plot all the 10 columns values in the chart

 

Thanks


First, stop saying "Excel file". You do not have an Excel file. That is something completely different. Your first question is "How to count how many rows the values were written". That's simply the size of the array that you wire to the Write To Spreadsheet File function. Surely you must have more code that what you've shown. Your next question is that you need to "read this values in the excel file and plot all the 10 columns values in the chart". Use the Read From Spreadsheet File and wire the output directly to a chart/graph.

 

To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.

Message 16 of 16
(1,271 Views)