LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read from spreadsheet function help

Hi
 
I have 2 csv files, each with like say 10 rows of numbers in column 1 only.   So its a 10x1 matrix.  I want to plot them using the read from spreadsheet functions (I created two Read from SS icons, each read in numbers from the two csv files.. have transpose to always true... index set to -1 to read whole file).  But the output of that returns a 2d array.  And I have trouble moving forward from that point.  I tried to change the output array dimension from 2 to 1.  Then link up the two 1d arrays to a bundle, then to xy graph.  That didnt work.  Can someone give me a hint on how to move forward from that? 
 
And is there a big difference between the xy graphs and the waveform graphs?
 
Thanks a lot in advance.
 
Jerry
0 Kudos
Message 1 of 4
(2,349 Views)

It would be helpful if you could post your code.  How are you changing the dimension from 2-D to 1-D. Simply using an index array to isolate the 1-D component out of your 2-D matrix should yield a true 1-D array output which you can bundle into an XY graph.  It SHOULD work the way you describe it but perhaps viewing the code will help in figuring out where the problem is.

0 Kudos
Message 2 of 4
(2,331 Views)
If you have transpose set to true, then you should just use the first row output of the Read From Spreadsheet. This is a 1D array. If you still want to use the 2D array output, then use an index array function and get row 0. You'll get a 1D array. If you don't want to set transpose to true, then use an index array and get column 0. The attachment shows the three different ways. They all produce the same graph.
 
The difference between a waveform graph and an XY graph is that the waveform graph displays evenly sampled data and the XY graph can display unevenly sampled data. When you create data for a waveform graph, you provide a y array, a t0, and a dt. With an XY graph, you provide a y array and an X array that may or may not contain unevenly spaced points.
Message 3 of 4
(2,329 Views)
The key was I didnt use index array to isolate the 1d array.  Now i got it.  Thanks. 
Message 4 of 4
(2,325 Views)