LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Processing .SPE files (from Princeton Instruments) with LabView

Hey juanni,

 

Have you attempted to use the VI's from apstorey? Try manipulating one of those VI's that inputs your .spe files and then you can remove the spectrum.

Ricky

National Instruments
Applications Engineer
0 Kudos
Message 11 of 33
(3,979 Views)

ActiveX basically controls one program with another.  In this case, we control WinView through a LabVIEW VI.  ActiveX alone doesn't truly add any additional functionality over what you can do with a SPE file that you can't do in WinVIEW directly.

 

I'm unsure how to modify SPE files directly without really combing through the file header (I think it is called WINHEAD.H and would have been installed with WinSpec or WinView) and then making significant modifications to any existant program.  Is there any specific reason you need it to be in an SPE file?  I typically prefer to have my files in tab-delimited text file because they are more portable.  Furthermore, you should then be able to simply add a pair of arrays to achieve what I think you are saying you want to do.  Send me your LabVIEW version (8 or above) and I can send you more files if the ones linked here are too new for you.

 

Andrew

0 Kudos
Message 12 of 33
(3,975 Views)

Yes, I have tried extracting the data from winspec files myself.  I can get close, but there is some problem with the scaling that has exasperated me for months.  I have read the descriptions of the various winspec headers as part of this, but still am unable to figure out the problem.  I have also looked at your files, apstorey, and cannot make heads or tails of what is going on.  I have managed to write a labview program that opens the winspec program and then hides it, but cannot figure out how to get it to open a .spe file that I could then get the data out of as a variant.  My labview version is labview 2010.  Thks for helping a luddite.  J

0 Kudos
Message 13 of 33
(3,971 Views)

Andrew- which of the files can I alter to open a file?  I can't figure out what is going on in them.  J

0 Kudos
Message 14 of 33
(3,966 Views)

I have significantly customized the program further for my specific purposes in order to write a raw data tab delimited file that is a 2d array of wavelength (y) versus horizontal space (x) (I rotate the image to do this - you probably have wavelength on the x-axis).  I also save a file where I normalize the data based on laser intensity.  While I doubt these are the specific functions of your instrument, I mention them to illustrate that moving away from the SPE file is probably the best way to go.  WinView saves an additional SPE file that I opt not to use because I can more easily handle the txt file which can be done with rather simple modifications to the posted code by inserting a write to file VI attached to the intensity display.  You may have to do a couple of data type conversions, but it really shouldn't be difficult.  If you only want wavelength vs. intensity, you could sum individual columns of the array either in LabVIEW or - depending how much data you are talking about doing this with - offline in Excel.

0 Kudos
Message 15 of 33
(3,964 Views)

the file Winx Control wgainnframesaving throws an exception... perhaps because I am running it on a computer without a camera on it?

 

0 Kudos
Message 16 of 33
(3,956 Views)

If WinView is not running on the computer and a camera is not attached, you will get exceptions.  I've attached here a much simple VI.

 

This version is significantly simplified.  You can view the SubVi as a black box that basically completes an acquisiton based on parameters you enter in the WinView program itself.  This is mostly how I use ActiveX because it would take forever to unnecessarily program every possible parameter I use - though you could do this for a few for a more dynamic instrument.  For instance, I have have used it to increase the gain from my iCCD.  So you run WinView simultaneously with LabVIEW and LabVIEW sends an activeX command to WinView to begin the acquisition.  You can also ignore Frame Variant, which is a basic acquisition parameter and the other two input parameters to the subVI are ActiveX libraries.

 

In the main VI here, I have taken the basic data output in an array and used an index array to transform the data into something useful.  I use 512 as the input for the for loop because I am using a 512x512 CCD chip, so alter that for yours accordingly.  The output is an intensity graph.  You can just as easily take the intensity graph and use the 2D array as an input for saving the data with a "Write to Spreadsheet File" VI.  You can also normalize the data from the 2D array or perform any of a variety of other data operations.

 

I hope this is more helpful than the previous version.

 

Andrew

0 Kudos
Message 17 of 33
(3,949 Views)

Andrew,

     Thanks for your help and patience.  I guess that perhaps I haven't communicated that I am not even trying to acquire anything.  I already have all the .spe files.  I just want to grind through them all in labview.  Of course, I could just use winspec to convert them all from .spe to .txt files (this is what I do now), but it seems unnecessary and just clutters up the hard drive and requires more steps from me.  If I continue on this line of research, I may eventually want to acquire data with labview, but for now, I just want to process the already extant .spe files on my hard drive.  J

0 Kudos
Message 18 of 33
(3,943 Views)

Hi Andrew,

 

I have LabVIEW 8.02 and couldn't open your posted much simple VI. Do you have a version compatible with this LabVIEW 8.02?

 

Thanks.

 

John

0 Kudos
Message 19 of 33
(3,920 Views)

Here is a version for 8.0.  There is one incrementing improvement between 8.0 and 8.6 for which you may need to make a minor modification.  If you can't find it let me know and I'll look over the code.

0 Kudos
Message 20 of 33
(3,916 Views)