LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a routine one can use to shift the column of data by one each time the loop index increments? In other words, increment the columns that the data is being saved by using the index?

The device, an Ocean Optics spectrometer in columns of about 9000 cells.I'm saving this as a lvm file using the "write to measurement file.vi". But it doesn't give me the flexibility as far as I can tell.

I need to move the column by the index of the for loop, so that when i = n, the data will take up the n+1 column. (the 1st column is used for wavelength). How do I use the "write to spreadsheet file.vi" to do this? Also, if I use the "write to spreadsheet file.vi", is there a way one can increment the file name, so that the data isn't written over. I like what "write to measurement file.vi" does.

I'd really appreciate any help someone can give me. I'm a novice at this, so the greater the detail, the better. Thanks!!!

 

0 Kudos
Message 1 of 4
(2,251 Views)

You cannot write one column at a time to a spreadsheet file, because a file is arranged linearly and adding a column would need to move (=read and rewwrite elsewhere) almost all existing elements to interlace the new data. You can only append new rows without having to touch the already written data.

 

Fields typically don't have fixed width. An exception would be binary files that are pre-allocated at the final size. In this case you can write columns by setting the file positions for each element. It still will be very inefficient.

 

What you could do is append rows until all data is written, the read, transpose, and write back the final file.

 

What you also could to is build the final array in a shift register and write the entire things to file at once after all data is present.

0 Kudos
Message 2 of 4
(2,247 Views)

Thank you for responding!

I'm trying something like this, but something is wrong, because the vi doesn't place the next array to a new column (or row). The vi is supposed to replace (and maybe that's the key word) an array with another at the point specified by the index.

Do you think I'm on the right track?

Or is this a problem that I can't solve as you indicated?

I just don't want to give up yet!

I would appreciate any ideas, hints, etc.

0 Kudos
Message 3 of 4
(2,211 Views)

I am not going to analyze a picture, please attach your VI.

 

In any case, you probably want to wire a TRUE to the "Append" terminal of the file write operation.

0 Kudos
Message 4 of 4
(2,198 Views)