LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read a spreadsheet, sort the data, and be able to select what data you would like to place on an xy graph

Hello,
 
I am a student who is working as a research assistant.  I have only just begun to use labview (just graduated highschool).  If someone could provide me with some instructions or build an vi that would help a lot.  My project is pretty simple.
 
I have data that was written into an text file that was imported into a excel spreadsheet.  I need a program that will, open the file, and sort the data, finding and selecting certian rows under specific column headers like, "Time" or "Temp 1."  I then need the data to be placed on an XY graph, where x is always time, and y is a selected group of temperature values.  The program needs to be able to find the header "time" and select certian row values for time after it looks under another column header named "Event".  The front panel needs a xy graph and place where you can select which temperature readings that you want to plot as a function of time.  The data table would look something like this..
 
 
0 Kudos
Message 1 of 3
(3,383 Views)

Date               Time      GAMMA  T01       T02         T03       T04         T05     Event
                     1:59:39      4      182.4       282.94    80.42    383.66     30.06       0
/30/2008      1:59:40      5      182.58     282.94    80.6      383.66       30.06      0
/30/2008      1:59:41      7      182.58     282.94    80.42     383.48      30.06      0
/30/2008      1:59:42      7      182.4       282.76    80.42     383.2        30.06      0
/30/2008      1:59:43      8      182.58     282.94    80.6      383.8         30.06      1
30/2008      1:59:44      4      182.58     282.94    80.42    38.3         30.06         1
/30/2008      1:59:45      4      182.22    282.76     80.42     38.12      30.06        1
/30/2008      1:59:45      1      182.22    282.76     80.42     8.12        30.06        1
/30/2008      1:59:46      1      182.4      282.94     80.42     8.48        30.06        2
/30/2008      1:59:47      1      182.22   282.94      80.42     8.3          30.06        2
30/2008      1:59:48      4      82.04     282.76      80.24     8.3         30.06          2

(This data is in an excel spreadsheet)

If the program can look at event and find the event number one data-- the times and temps for event one.  On just an XY graph where x is time and y is selected temperatures.  If the front panel had a place where all the temps could been seen and selectable so that i could graph t1 and t2 or t2 and t3 or all of them even.  This spreadsheet however is just an example and there will be around 32 temperature columns.  There will also be various other columns so the program will need to find data under specific headers.  If anyone has suggestions thoughts example instructions or programs that would help me please pass them along!! 


 



Message Edited by bradley_shields on 06-11-2008 10:43 AM

Message Edited by bradley_shields on 06-11-2008 10:46 AM
0 Kudos
Message 2 of 3
(3,375 Views)
You need to break this problem into separate parts. First, do you have an actual Excel file, or is it a tab-delimited text file which looks like a spreadsheet file with rows and columns? If you have an Excel file then you need to use ActiveX in order to read in the file. You can look over in the Excel board/thread for lots of Excel functions. Attached is a VI that I lug around that will read in an Excel worksheet given a start and end range. The data output is a 2D array of strings. In your case this will work, but your Date column looks a little wonky.

The other part is the graphing. I would suggest looking at the LabVIEW examples that show how to do graphs. Given that your time values are not evenly spaced you should use an XY graph.

Another part is the selectable operation. This basically involved using the Index Array function to pick off the columns you want and creating the XY data for the clusters. You should first understand how to create graphs, though.


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.
0 Kudos
Message 3 of 3
(3,346 Views)