09-23-2013 04:49 AM
Hi , I'm trying to continuously save spectra in to spreadsheet.
The problem with my VI is it saves the first column with wavelengths what it supposed to do and the second column with the first spectrum the rest of the spectra aren't saved.
09-26-2013 02:59 AM
Hello Dennis,
I don't have the specific device library installed that you're using in your code.
I don't really see what you're tryin to accomplish with your different array operations.
Based on your code:
- You have an empty array
- You fill the first column with your wavelengths
- This pre-filled (first column) 2D-array is the starting point for all of your next iterations
In iteration i (i=0,1,2,3,...) :
- the (i+1)-th column will be non-zero and the other columns (between the first wavelength column and the (i++1)th column will be zero
Can you share an example of how your saved data file currently looks like and how you would like it to look like?
As far as it seems you want to have 1 column for each measured spectrum.
10-01-2013 03:40 AM
Hi Thierry,
I'm currently working in a lab that investigates methods for effective removal of pharmaceuticals in wastewater. I have to develop a program for research that constantly takes a spectrum( waveform like) lets say every minute. I don't know how long the experiment runs. I have to save these spectra for analysis afterwards.
The program kind of worked , the only problem that remains it only saves when I quit the while loop, and not during. I also can't figure out how I can constantly adjust my array to the right amount of spectra because I don't know how many spectra I would have to take because the length of the experiment isn't defined. The first column of the array needs to be the wavelength and the rest of the columns are the intensity of the spectra at a certain wavelength. That's why I premade an array with a 1000 columns with wavelength assigned to the first column and then constantly replace a column that is filled with 0's with a spectra.
10-02-2013 08:57 AM - edited 10-02-2013 08:58 AM
Hello Dennis,
Is there absolutely no upper limit for the duration of the test?
For example:
Should it run continuously for years or do you know that it will at maximum run for a few days/weeks? (I'm just looking to an idea about an upper limit).
Can you share this latest code you're talking about?
10-02-2013 10:38 AM - edited 10-02-2013 10:47 AM
You can have the data saved by feeding the output of your measurement, 1D array, into the 1D array input of the "Save tp spreadsheet file" function.
As the previous post indicates, the file will grow until it is a ridiculous size if allowed to run forever (or the data from the spectrometer is large). You can have a file name generation routine that checks the size of the file and at some arbitrary size changes the name of the file you are saving to, appending a number on the end of the file name for instance. This would take as its input the file path reference, and then could look at the file size using the "get file size" function from the "Advanced" palette in File I/O, when it is greater than a certain size, use the file functions strip path and build path to change the name accordingly.