LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

My data doesn't append

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.

0 Kudos
Message 1 of 5
(2,834 Views)

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.

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
Message 2 of 5
(2,770 Views)

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.

 

 

 

0 Kudos
Message 3 of 5
(2,734 Views)

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?

 

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 4 of 5
(2,697 Views)

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.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 5 of 5
(2,678 Views)