LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2D array to a spreadsheet

Solved!
Go to solution

Hi,

 

The program in the attachment is controlling a spectrometer and reading a CCD. First the spectrometer is initialized and then the CCD.

 

I would want to write in a file the output of the CCD. For reaching this aim I've utilized 'write to a spreadsheet'. The program is working, but I obtain a file of only one column. Why? 

 

The other problem is that the stop buttom is not working, if I introduce this 'write to a spreadsheet'. Why?

 

Thank you very much.

 

Eleonora

0 Kudos
Message 1 of 4
(1,011 Views)

If you wire the values to an array indicator, are you getting multiple columns worth of data?

 

Is this a tab delimited file or a comma separated? It's good practice to specify that as an input to the VI. Also, you don't have to transpose the array, since you can specify that as an input to the VI.

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 2 of 4
(1,003 Views)

Hi Adnan!

 

I wired an 2D indicator and I obtained only one row of results! I can't understand how it is possible. Why an 2D array is giving me an output as a 1D array?

 

I also put the transposition directly on the 'write file'. How can I put the tab condition?

 

Thanks,

 

Eleonora


@adnan Z wrote:

If you wire the values to an array indicator, are you getting multiple columns worth of data?

 

Is this a tab delimited file or a comma separated? It's good practice to specify that as an input to the VI. Also, you don't have to transpose the array, since you can specify that as an input to the VI.


 

0 Kudos
Message 3 of 4
(997 Views)
Solution
Accepted by topic author Giallina

If your Number of Regions is 0 or 1, then you are sending a 2D array with only a 1D data set to the array manipulation cases, so it seems reasonable that you only get one row.

 

Your stop button is not connected to anything.  Why would you expect it to work?

 

Also the On switch terminal is outside the while loop, so its state will be read before the outer while loop starts.  If it is true the while loop will never stop.  The stae will not be read again inside the loop so changing the switch after the loop starts will have no effect on the program.

 

Sequence structures, local variables, global variables which are never written, duplicated calculatioms, data which never changes in a shift register, loops which never stop: It appears that you have written a program with all the LabVIEW beginner errors.  If you have not done so, please work through the on-line tutorials.  It will make your life much easier and your programs work better.

 

Lynn

0 Kudos
Message 4 of 4
(989 Views)