LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2D array in excel

hi folks,

i have to copy an 2D array into excel. what is a good way to do this? and
how i can format the cells/boardes/... in excel
i work with win95 and labview 5.1


thanks
reto
0 Kudos
Message 1 of 5
(5,158 Views)
You should just be able to write to a spreadsheet file, and use a delimieter
like tab or ",". Then Excel will be able to read it. The other way is to
use AciveX. I'm sure that this way is better (you can format cells...etc.),
but harder to program.

Note: if you have strings that you want to import, the "write to spreadsheet
file" won't work. What I did is simply create a huge "concatenate strings"
block and wire my strings into every other input. Then I put commas in
between my strings, and added a "new line" character to the end... then just
used "write characters to file". Excel will still be able to read this
comma-delimited file.

Rick
0 Kudos
Message 2 of 5
(5,158 Views)


> Note: if you have strings that you want to import, the "write to
spreadsheet
> file" won't work. What I did is simply create a huge "concatenate
strings"
> block and wire my strings into every other input. Then I put commas
in
> between my strings, and added a "new line" character to the end...
then just
> used "write characters to file". Excel will still be able to read
this
> comma-delimited file.
>
> Rick
>
>

Instead of creating a comma delimite file this way, you could use
the "format into string" function and use "%s,%s,%s,%s\r\n" as your
format string (depending on how many elements you have; also \r\n is
the end-of-line character for the PC). This turns out to be a much
cleaner solution.


Sent via Deja.com http://www.deja.com/
Before you buy.
0 Kudos
Message 5 of 5
(5,158 Views)
primelline wrote in article
<7tica6$95m$1@exnews.swisscom.com>...
> hi folks,
>
> i have to copy an 2D array into excel. what is a good way to do this? and
> how i can format the cells/boardes/... in excel
> i work with win95 and labview 5.1
>
>
> thanks
> reto

The communication protocol DDE is a good way to start with. Besides, it is
quite well documented in the LabVIEW help, where you can find several
examples. I've used it myself in several occasions and it worked fine for
me.
Active X is much more powerfull but it is much more complicated and it is
not very well documented in the LabVIEW help. Depend on what you want.
Hope that it helps !


--
Para responder retirar NOSPAM do endereço de e-mail.
To reply remove NOSPAM from e-mail a
dress.

Luís Miguel Cabrita
Email: lmcabritaNOSPAM@hotmail.com
Home Page: http://home.eunet.pt/jcabrita/
0 Kudos
Message 3 of 5
(5,158 Views)
primelline wrote:

> hi folks,
>
> i have to copy an 2D array into excel. what is a good way to do this? and
> how i can format the cells/boardes/... in excel
> i work with win95 and labview 5.1
>
> thanks
> reto

I dont know about the border / cell formating
you may have to use ActiveX (dont know about this).

To get the data into excel just use the "Write to Spreadsheet"
This will format the data into a tab delimited format
that Excel can then read.
Kevin Kent
0 Kudos
Message 4 of 5
(5,155 Views)