cancel
Showing results for 
Search instead for 
Did you mean: 

write excel file

SOLVED
jess1006
Member
Solved!

write excel file

Message contains an attachment

Hello!

 

I am trying to generate an excel file (.xls or .csv) which contains four columns, data for each column is an array of doubles. I have tried several ways to get it (using commas with the csv and tabs withe xls) but i am not able to get the four columns of values. How can I do this?

 

Also, I would like to know if it is possible to include an image (of a chart generated in the VI) in the excel file that I am trying to generate.

 

Thanks in advance,

 

Jessica

17 REPLIES 17
Artem.SPb
Active Participant

Re: write excel file

Message contains an image

This sample generate 4-column file

4c.png  txt.png

 

 

If you want work with excel you need LabVIEW Report Generation Toolkit 

Bob_Schor
Knight of NI
Solution

Re: write excel file

As Artem noted, to work with Excel (meaning to output a file in an Excel-specific format, .xls or .xlsx, as opposed to a text file delimited by Tabs or commas, the latter called "Comma-separated-value" files, extension .csv, a file that Excel "hijacks" by assigning it an icon that suggests it is a native Excel format), you need the Report Generation Toolkit, standard now with LabVIEW 2014 and 2015, but an add-on for LabVIEW 2012.

 

You can use the Write to Spreadsheet File (which, as noted, writes tab-delimited files, though you can specific comma-delimited to give you .csv files).  Just arrange your data as a 4-column, many-row array of numeric or text data.  I don't use these functions, myself, though I do use the RGT to read/write .xlsx files ...

 

Bob Schor

jess1006
Member

Re: write excel file

Thank you Artem and Bob!

 

In the end I am using TDMS files as are easy to work with and can be open easily in excel. Do you know if it is possible to "write an image" generated in labview (image of a chart) in a .tdms file?

 

Thanks again,

Jessica

NataliaS
NI Employee (retired)

Re: write excel file

Message contains a hyperlink

Hey,

 

You cannot store directly an image in TDMS file but there is a work around

 

Maybe this article can come in handy:

https://forums.ni.com/t5/Example-Code/Storing-Images-in-TDMS-Files-Benchmarks-and-Example-Code/ta-p/...

 

Regards,

-Natalia

jess1006
Member

Re: write excel file

Message contains a hyperlink

Thanks Natalia!

 

I nave seen i need to download the IMAQ drivers. I am using LabVIEW 2012 so i have seen in a forum (http://forums.ni.com/t5/LabVIEW/Where-can-I-find-IMAQ-4-7-for-download/td-p/2451692) that i can download it from here:

https://www.ni.com/en/support/downloads/drivers/download.ni-device-drivers.html#327629

 

However according to this page this a download of device drivers...

Can anyone tell me if I should download this just to get the IMAQ drivers?

 

Thanks a lot in advance!

NataliaS
NI Employee (retired)

Re: write excel file

Message contains a hyperlink

Hey,

 

It seems like the .vi is using some peaces of vision acquisition software, indeed the link you posted is where you should download the driver from.

 

I am not sure whether the .vi will work after you have downloaded the driver if you don't have vision acquisition software.

 

Could give it a go tho

 

Regards,

-Natalia

 

Check drivers compability withthe LabVIEW version you have:

 

https://www.ni.com/en/support/documentation/compatibility/17/vision-acquisition-software-and-labview...

 

NataliaS
NI Employee (retired)

Re: write excel file

Message contains a hyperlink

Hey,

 

It seems like the .vi is using some peaces of vision acquisition software, indeed the link you posted is where you should download the driver from.

 

I am not sure whether the .vi will work after you have downloaded the driver if you don't have vision acquisition software.

 

Could give it a go tho

 

Regards,

-Natalia

 

Check drivers compability withthe LabVIEW version you have:

 

https://www.ni.com/en/support/documentation/compatibility/17/vision-acquisition-software-and-labview...

 

BIJOE
Member

Re: write excel file

Message contains an image

hi

 

i m bijoe

 

i m having doubt on saving excel file using write to measurement file icon...

I have attached the image format of the saved measurement file .While the file is saved , it generates header as untitled,untitled1,untitled2,,so on as shown on the image.Please suggest me a solution to change the header of  excel file through VI program according to my convenient.

 

 

Picture1.png

jess1006
Member

Re: write excel file

Message contains an attachment

If you are writing the excel file with tdms it is easy. Just add the the header of the column as shown in the image attached.