LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Open Spreadsheet and Display in Table and Graph

I have a spreadsheet file that contains about 15 columns of data acquired in LabVIEW. I would like to open this data in another vi, display certain columns in a table, and graph them accordingly.

For instance I would like my table to look like this:

Column 1 Column 5 Column 8 Column 15
x x x x
x x x x
x x x x
x x x x

etc.. (where the emitted column numbers still exist in the spreadsheet, however, they are not displayed to the user at this time
.)

Then I would also like to take the values from this table and graph them -- I would like to graph the last three columns as my 'Y' values, and the first column would represent my 'X' values.

Thanks a ton.
Travis
0 Kudos
Message 1 of 2
(3,825 Views)
Hi,
you must do the folowing things:

1.Read data from spreadsheet file into 2D array with
"Functions->File I/O->Read from spreadsheet file.vi". You can specify offset to not to read the names of columns.
Take then 2D array output to use it as 2D array of doubles.

2.Text tables are actually the 2D string arrays. These controls are located in "Controls->List&Table" palette.
So you need now to convert your 2D array of doubles to 2D string array. To do it you can use functions from "Functions->String->String/Number conversion' palette. For example "Number to fractional string.vi". And now wire the output to Table indicator node.

3.To show graphs you need to use "Controls->Graph->XY Graph" control. To plot graph you need to bundle "X" and "Y" columns from 2D
array of doubles into cluster and wire it to graph node. To bundle them you must use "Functions->Cluster->Bundle.vi". To extract specific columns from 2D array you must use "Index array" function from array palette.
If you want to plot several curves on on graph you need to organize corresponding clusters into array and then wire it to th graph node. To do it use "Build array function from array palette.

Good luck.

Oleg Chutko.
0 Kudos
Message 2 of 2
(3,825 Views)