LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problems with express xy graph

Hi,

I am new to Labview. I am using Labview 8.5. I wish to create a program which reads in an excel spreadsheet and displays the data on an express xy graph. I have been able to read my excel spreadsheet into labview but cannot display a graph in my express xy graph. The express xy graph plots only one point and I do not understand why. I would be grateful if someone could please advise me on what the problem could be. The block diagram is shown below.

Your help is very much appreciated. Thank You.

Dibz

 

 

 

 

Express XY Graph.jpg

 

 

0 Kudos
Message 1 of 7
(4,140 Views)

Your first problem is that the Read From Spreadsheet File function cannot read native Excel files. It can only read text files. You would have to export the Excel file as comma or tab separated data. Second, if you want to read a single file, it makes no sense to use two Read From Spreadsheet functions. Lastly, wiring a 2D array to the x and the y inputs is almost certainly incorrect. You are able to do that because Dynamic Data types allow for some truly bizarre wiring.

 

If you really need help, you need to post the file you are trying to read (after you have converted it to text, of course).

Message 2 of 7
(4,126 Views)

Yes I have already read the excel files into labview by converting them into text files. I did state I have managed to read the files into Labview so that isn't the problem.

 

The arrays are only there so on the front panel the data that I am reading into Labview is displayed, they have nothing to do with me trying to put data into the express xy graph.

 

The reason I have used two Read From Spreadsheet functions is because I have actually split the original file into two files so that one file is used to set the range of the x-axis and the other file is the y-axis values. Sorry I did not make that clear earlier.

 

Do you have any ideas as to why the express xy graph is only plotting one point?

 

0 Kudos
Message 3 of 7
(4,111 Views)

I think the data is actually in a column, not a row.  Try putting a transpose array in between the read and graph.  You may need an Index Array in there too to get just the first row, a 1D array.  Right now you're passing in a 2D array.  I'm not sure how it handles 2D.

 

Additionally, you could transpose the text file itself, then use the first row output of Read from Spreadsheet.

 

Are each of the files supposed to be just one row (X and Y)  Why not make one file with two rows?

Message Edited by elset191 on 01-21-2010 01:58 PM
--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 4 of 7
(4,106 Views)

If you had converted them, then you should have said you were reading text files and not Excel.

 

If you really want an answer, then post the files. No one here has any idea of what the contents are or how you have the data arranged. I asked for that originally. If you have a single x axis and a single y axis, then the wiring of the 2D output from each makes even less sense.

0 Kudos
Message 5 of 7
(4,102 Views)

To elset191: I have actually added a transpose array between the Read From Spreadsheet and the express xy graph and it now displays a full graph! Thank you. I mistakenly thought the xy graph read in the data in columns rather than rows. However, the y-axis values is a 2D array. Therefore, ideally I would like each row of this data to generate its own plot on the xy graph. Can it do this? At the moment the express xy graph looks like its only reading in the first row of y-axis 2D array. Would I be able to somehow show multiple plots on the express xy graph for each row of the data?

 

To Dennis Knutson: Apologies, but i thought it would have been assumed that as you cannot read in native excel files as you said, then obviously I had converted the file if I initially stated I had read it into Labview. Also, as stated above the y-axis is actually a 2D array which is why I used the 2D array to display it. Granted, the x-axis values is a single array but no problems were incurred so I did not get around to changing it. 

0 Kudos
Message 6 of 7
(4,053 Views)

You still won't post the actual text files. I've already heard you say that you converted them. You don't need to repeat.

 

Why don't you just use a regular XY graph? Look at how a multiple plot is created whenyou have context help turned on. It's pretty simple to create the cluster and then the array of clusters.

0 Kudos
Message 7 of 7
(4,048 Views)