01-23-2019 05:34 AM
Hi all,
I'm using a spectrometer VI that requires both a dark and light reference before processing. The spectrometer itself outputs a spectra in the form of a 1d array. In some rare occations, I cannot take new dark and light reference spectra due to sample issues and would like to use the last taken reference spectra (probably from the last time the VI was run).
Basically what I need to do is save the reference 1d array somewhere that can be called upon when the instrument is run again. I'm guessing, having it written to a file that can be read when called. What would be the best way to write a 1d array to a file so that it can be converted back to a 1d array as efficiently as possible?
Or is there a better way to do it that I'm missing?
Thanks
Solved! Go to Solution.
01-23-2019 05:46 AM - edited 01-23-2019 05:46 AM
Hi Potticare,
What would be the best way to write a 1d array to a file so that it can be converted back to a 1d array as efficiently as possible?
WriteToBinaryFile to save the data, ReadFromBinaryFile to load the data later…
(You may use some other functions from the File functions palette, but they mostly add a layer of overhead.)
01-23-2019 05:48 AM
The most efficient way would be to write it as a binary file, but the common way is to write it through Write delimited text file so it's human readable. Take your pick. 🙂
/Y