LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Graph from file. DImension problem

Solved!
Go to solution

Hello. I have a problem drawing an XY graph from file. I managed to plot one graph, but I need 3 graphs plotted on one XY graph.I have 4 txt files with 1D arrays (just one column) of data. 1st: only X values, the rest 3 are Y values. Could you please answer what is the mistake in my block diagram and how to solve it?

0 Kudos
Message 1 of 3
(2,766 Views)
Solution
Accepted by topic author Feyz
Essentially, nothing is correct on the block diagram. If you use the Read From Spreadsheet to return a 2D array, then you should use the Index Array function to get a single column as a 1D array. You are using the Array Subset which is returning a 2D array as is clearly visible. However, you can make things much simpler by using the Read From Spreadsheet in the correct manner. Set the Transpose input to True and take the First Row output. This is a 1D array.
Message 2 of 3
(2,749 Views)

For new users it's sometimes confusing that Array Subset always returns the same type of array as the input, even though you may be selecting a range that amounts to a row or a column. This has been a source of confusion for new users from day one, so don't feel too bad. Smiley Wink

 

You should also provide path controls with actual paths set for the Read From Spreadsheet File VIs. As it is, with no path wired to them the Read From Spreadsheet File VI will prompt you. Since there is no data dependency on the individual instances you won't know which one it's asking for first. It may not matter in your specific case, but you should not make something that's ambiguous.

0 Kudos
Message 3 of 3
(2,736 Views)