LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read from csv file and plot particular columns

Hello,

I`m a new user of Labview and here it comes...my first major problem.

Maybe this has been discussed before. I’ve made a search to solve my problem first but I couldn`t find anything helpful so I `ve decided to post a new message.

So here is my problem:

I`m working in a small semiconductor lab where different types of nitrides are grown using proprietary reactor. The goal is to read the collected csv files from each growth in Labview and plot the acquired data in appropriate graphs.

I have a bunch of csv files and I have to make a Labview program to read them.

The first part of my project I`ve decided to be displaying the csv file (growth log file) under labview (which I think works fine).

The second one is to be able to plot particular columns from the recipe in graphs in Labview (that one actually gives me a lot of trouble):

1. Timestamp vs Temperature /columns B and D/

2. Timestamp vs Gas flow /columns L to S/

3. Timestamp vs Pressure /columns E,K,T,U,V/

I`ve got one more problem. How can I convert the Timestamp shown in csv file to human readable date in labview? This actually is a big problem, because the timestamp is my x axis and I want to know at what time a particular process took place and I also want to be able to see the converted timestamp when displaying csv file at first. I`ve read a lot about time stamping in excel and timestamp in labview but I`m still confused how to convert it in my case.

I don`t have problems displaying csv file under Labview. My problems are with the timestamp and the graphs.

Sorry for my awful English.Smiley Sad  I hope you can understand my problems since English is not my mother language. 

Please find the attached files.

If you have any ideas or suggestions I`ll be more than happy to discuss them.

Thank you in advance.

Have a nice day! Smiley Happy

Download All
0 Kudos
Message 1 of 11
(5,271 Views)

Let's back up.

 

Where did you get this .csv file?  Did you create it in LabVIEW, or with another program?  Did you create it with Excel?

 

If it is truly a text based .csv file, why you using Excel ActiveX commands in LabVIEW to read it rather than the Read from Spreadsheet File function?

 

My guess is that you started in Excel.  Dates in Excel are based on the number of days since a given point in time.  Dates/Times in LabVIEW are the number of seconds since Jan 1, 1904.  You need to convert values from Excel time to LabVIEW time.  If you search the forums, you'll find quite a few threads discussing this.

0 Kudos
Message 2 of 11
(5,267 Views)

Thank you for the quick response.

The log files come from another labview program controlling the reactor.

These files contain the all information about what was happened during each growth.

I did a search about time stamping, but I`m still confused and I do not know how to convert it in my case.That is why I posted a new massage to get some help about time stamping and the graphs.

0 Kudos
Message 3 of 11
(5,260 Views)

Look at this Idea Promote Functions on Timing Palette for a function that converts a timestamp to Excel time.  You just need to do that in reverse.

 

Also look at Can't get Right Real time when calculate from back to, 01-01-1900 00: 00: 00

0 Kudos
Message 4 of 11
(5,254 Views)

Thank you, Ravens Fan!

This maybe is a very stupid question but....

How can I tell labview which columns to plot? What finction should I use?

Would you help me in that direction? 

 

0 Kudos
Message 5 of 11
(5,243 Views)

Read from Spreadsheet File gives you a 2-D array.  You just need to use Index Array to grab a particular column out of it, (leave the row input unwired).

0 Kudos
Message 6 of 11
(5,215 Views)

Hello again,

 

I`m having problems with converting the first column in the attached above file Growth Log.csv.

I have a code converting xl timestamp to time and using Index Array traying to grab a particular column out of it but the attached file is written in strings so I guess I have to redo it in array but I don`t know how.Would you help me with this one?

0 Kudos
Message 7 of 11
(5,189 Views)

Hi vasgeo

 

For this .vi you attached, you would need to feed it a single string (probably a single element of the array you are talking about). If you have an array, you could create a For Loop to iterate through your array and convert each timestamp one at a time (element by element). I looked in the Growth Log.csv you attached previously and the timestamps appear to be numbers, which may be different than the format used in Excel though.

 

Jason L.

Product Support Engineer
National Instruments
0 Kudos
Message 8 of 11
(5,151 Views)

Hello Jason L,

Thank for your response.

Creating a For Loop to iterate through the array and convert each timestamp one at a time (element by element) is a good idea. I`ve been trying to do it but I`m very busy in the Lab these days and considering the fact that I am a newbie I would appreciate it if you give me some hints.

Thank you in advance!

 

0 Kudos
Message 9 of 11
(5,134 Views)

Vasgeo

 

All you need to do is "pop off" each element in the loop with an Index Array to be fed into the function and increment the index in each iteration. A for loop will keep the iteration count for you if you use a while loop then you would want to manually increment the index and use a shift register to keep the value each iteration. Write the result of the function into another array or wherever you want it to go.

 

Jason L

Product Support Engineer
National Instruments
0 Kudos
Message 10 of 11
(5,129 Views)