LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel File Conversion thru LabVIEW

Hello, again, to all..
 
This may be an annoying cry for help, but I've run out of options. Smiley Sad
 
I have two text files from the same exact scans but a conversion factor and plotting differential is holding me back.  The first scan, that I wish to duplicate, produces a text file with two columns (wavelength and transmission) and the second scan, that I wish to convert and change the layout of, produces a text file with twelve columns (first = wavelength, second thru twelfth = transmission values).
 
I contacted the manufacturer of my spectrophotometer and they told me the conversion from one to the other is as simple as scalar 0 to 1, to percentage 0 to 100.  However, it appears they do not know what they are talking about...  The conversion factor I found between the two scans is a simple multiplication or division of 319.773.  It may be off slightly to the hundredth or thousandth decimal place, but that doesn't trouble me.
 
In lamence terms, what I am trying to do is make text file #2 look like text file #1 somehow by using Labview.
 
Any help or suggestions will be greatly appreciated.
 
Thanks Smiley Tongue
 

Message Edited by Steve.Briggs on 01-18-2007 10:21 AM

Download All
0 Kudos
Message 1 of 8
(3,627 Views)
Try this and see if it works for you.  You will to add in the header again and save the file, but it should get you started.

Message Edited by Kenny K on 01-18-2007 10:23 AM

Kenny

0 Kudos
Message 2 of 8
(3,597 Views)

The attached will read the file and apply the scaling to columns 2 through x and then replace them in the original array. It just uses the Array subset and the Replace Array Subset. You didn't say if you wanted to combine columns 2 through x in some manner (i.e. take the mean) and have a single column. Also, I didn't do anything with the header. You would want to read that in as characters and then rewrite that out. this should get you started though.

Message Edited by Dennis Knutson on 01-18-2007 09:23 AM

Message 3 of 8
(3,600 Views)
oops, forgot that there was multiple columns to changeSmiley Surprised
Kenny

0 Kudos
Message 4 of 8
(3,580 Views)
Dennis,
 
I read my files through the set up you made and I got the transmission percentages I needed in an array.  I changed the numeric constant of 3 to 0, the conversion had to apply to my entire field with the exception of the first column of wavelengths.
 


@Dennis Knutson wrote:

You didn't say if you wanted to combine columns 2 through x in some manner (i.e. take the mean) and have a single column.


Combining the columns would make my XY graph a little easier, but I wouldn't know how to alter the wavelength values to match up accordingly with the total number of transmission values (I hope that makes sense).  When making the cluster leading to my XY graph I can't seem to get the right bundle of elements.  I have the output array of my scan data being read into the cluster, but I don't know whether or not to wire in something off of the mean (DBL value; doesn't work), or something off of the index array before it.
 
Is there is a way I can get a proper plot on the graph with the entire array?  Or do I have to simplify it to one X column, and one Y column and then go on from there?
 
Attached is the VI to the point I am currently having trouble with.  Disregard the subvi's prior to the last frame, I am having no trouble with them.
 
Thanks Dennis

Message Edited by Steve.Briggs on 01-18-2007 01:21 PM

0 Kudos
Message 5 of 8
(3,572 Views)

What exactly are you trying to plot because what you have doesn't make much sense to me. You've done the scaling and then the replacement but then you have two Index Array functions that get the exact same data from the 2D array. All that you are doing is extracting row 0 and because the first line in the file is text, it's all zeroes. What do you really want as the x and y axis. Also, with a file with multiple columns, how do you want that graphed versus a file with only the two columns.

Also, you cannot use a local variable for 'output array'. The way you've done it, you are guaranteed what s called a race condition. The local variable will be input to the index array function before the output array indicator will be updated.

Message 6 of 8
(3,558 Views)
What I am trying to plot is the transmission percentage (Y axis) over the set wavelengths (X axis).  The plot should produce 5 slightly increasing lines.
 


@Dennis Knutson wrote:

Also, with a file with multiple columns, how do you want that graphed versus a file with only the two columns.


I had no problem graphing the file with only the two columns, but I am having the problem with graphing the file with multiple columns.  Is there a way I can take all of the columns and graph them, or do I have to somehow turn them into a two column file?  I was able to graph the file with multiple columns, but I only graphed the first and second column of the data set and my graph values were different than my transmission values because I wasn't taking all of the data.  In no way do I want to graph the file of two columns against the file of multiple columns.
 
I noticed the race condition from the local variable 'output array', I had thrown that in just to see if I could take the data from the entire array and it turned out I couldn't.
0 Kudos
Message 7 of 8
(3,554 Views)
This works on the file called 2.txt that you posted.
0 Kudos
Message 8 of 8
(3,547 Views)