LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

help needed! plz

Solved!
Go to solution

Hi,

 

I am trying to save output array from labview into excel. I have attached the code I have developed. I am sorry it is a little big. I wanted to add just the snapshot, but I could not figure out how to. You do not have to look at the whole thing, just concentrate on the part after the frame that operates with arrays. I am able to open the file that I need in excel but everytime I open it, I have to either choose excel from a list of files and can't even select "always use the selcted program to open this type of file" option, or else I have to type in .xls in the file name before saving it. I am sure there must be an easier way to save the files. I am very new in labview or any computer programming for that matter, so donot have idea about the functions that it has. I was even wondering if I can make labview automaticcaly save the spreadsheet in excel without even prompting me to hit the save buttom evertime the reading is complete.

 

Thanks in advance!

0 Kudos
Message 1 of 12
(3,410 Views)

duplicate post

 

Have a little patience!

0 Kudos
Message 2 of 12
(3,403 Views)

Please use a little more descriptive title for the subject of your message.

 

I am not clear what issue you are having.  Are you entering a filename in the path control?  If you leave it empty, it will pop up a dialog box.

 

What file extension are you using to save it?

 

Another problem you have is that your array is 651x 651.  Excel can only have up to 256 columns, so you will get an error message when you open up a file that has been saved with 651 columns.

 

Do you realize that the Write to Spreadsheet File VI (one of the most poorly named ones in LabVIEW) does not create and Excel file (which has become synonymous with spreadsheet).  It only creates a text file that has been formatted in a way that allow Excel to import it.  Depending on which file extension you choose and what delimiters you use, Excel can import it just fine, or it can have problems and not recognize columns. (commas can cause problems if the file is not saved with .csv extension).

0 Kudos
Message 3 of 12
(3,398 Views)

Sorry if I was unclear. I was trying to program labview to automatically save the output array as an excel file. Everytime the reading was complete, it was prompting me to save it, which I did not want. I now figured out how to do it (specified the file path in the front panel), but now I have another problem-i cannot create a new file whenever a new data is received instead a dialog box appears asking if I want to replace the old file. Is there a way i can save all the files with the received timeor date as the file name? Thank-you!

 

ps- I am able to open the file in excel, it gives all the 651 columns, so I do not have any problem with that part! 

0 Kudos
Message 4 of 12
(3,381 Views)
You can programatically build your file name.  Look under the File I/O palette and the Advanced File palette under that.  You can build paths and use string functions and convert them to paths to create the file name.  Also search the forums for numerous examples.
Message 5 of 12
(3,374 Views)

I would recommend trying the 'build path' functions before trying to convert strings into paths.

(Mostly just because Dennis yelled at me before for the latter of the two :smileysad: )

 

But he was correct, because then this ensures that the VI is platform independent, and you dont make problems for yourself down the road.

Cory K
0 Kudos
Message 6 of 12
(3,369 Views)

Hi,

 

You can append present date and time in string format with your default path name.

 

check the attachment....

 

 

Anil

Anil Punnam
CLD
LV 2012, TestStand 4.2..........
0 Kudos
Message 7 of 12
(3,367 Views)

Cory K wrote:

I would recommend trying the 'build path' functions before trying to convert strings into paths.

(Mostly just because Dennis yelled at me before for the latter of the two :smileysad: )

 

But he was correct, because then this ensures that the VI is platform independent, and you dont make problems for yourself down the road.


 

True, but you still usually need to do some string functions to do things like format the date.  The think the knock against string functions come when you are trying to do things like put in backslashes or determine the drive letter or root directory.
0 Kudos
Message 8 of 12
(3,361 Views)

Yeh, thats pretty much what I did.

I made string constants by copy and pasting the first part of the path.

Then I used a bunch of string concatinations and other string functions.

.... it wasnt pretty

Cory K
0 Kudos
Message 9 of 12
(3,359 Views)

Hi Anil,

 

I am using an older version of labview, so could not open the attachment. Can you please save it as a 7.1 version and send it again?

 

Thank-you very much!

 

Sweta 

0 Kudos
Message 10 of 12
(3,336 Views)