05-16-2008 02:13 PM
http://digital.ni.com/public.nsf/websearch/562D29142BF79B4E862570D10074E3CC?opendocument&Submitted&&node=133020_US
I tried the ASCII format. It works if the spreadsheet contains not so much data. I have to break the spreadsheet into several sub spreadsheets if there is too much columns in it. Though it works, it's not pratical for me. Because I have lots of files. So I tried the binary format.
The example posted there doesn't work in LabVIEW 8.5 that I am using.
Does anyone know how to modify it for LabVIEW 8.5?
05-16-2008 02:32 PM - edited 05-16-2008 02:39 PM
05-16-2008 09:18 PM
Hi Mike,
I can't access the files in my office at home. So I can only describe the problems I met for now.
The ASCII format partially works. For some reason I couldn't load the file generated by LabVIEW Write to Spreadsheet File.vi directly by MatLab. I had to copy and paste a portion of the columns in the original file to a new Spreadsheet file. Then MatLab can load the new file. I have to create a few ( maybe a lot ) separate spreadsheet files in order to use all the data in the original file. So it's impracticable because I will have a lot of files need to be processed.
Then I tried the example attached in the knowledge base article. The article's link is:
When I used LabVIEW 8.5 to open the SaveAsMatFile.vi and run it, there was a pop-up window asked me to select a file. I selected the file I wanted to convert and click OK button. There was no error message. But it stopped in less than 0.5 second. Basically, it stopped right after I clicked the OK button. I checked the selected file and the file was the same as before. I check the Conv2Mat.vi used by SaveAsMatFile.vi, there was error message in the front panel ( not a pop-up window ). The message was: " Source. Convert to MAT (data). "
I couldn't get the converted file. The file I wanted to be converted is unchanged and there wasn't new file created.
The knowledge base article says: " The example SAVML Example.VI
in the attached zip file, available for LabVIEW 7.1 and LabVIEW 8.0, can be used to save LabVIEW data in the MATLAB® .mat
format. " So I suspect the SaveAsMatFile.vi and/or Conv2Mat.vi can not run properly in LabVIEW 8.5.
Which version of LabVIEW you are using?
I hope my description is detailed enough. I can send you my data files and screenshot next Tuesday if you think it's helpful.
Best Regards
Min
05-17-2008 02:08 AM - edited 05-17-2008 02:10 AM
Hi Min,
you have to select the target file if the popup window ask you for a file. Did you see the content help of the vi? You have to open the file you want to convert seperately and connect the data to the 2d input.
Mike
05-19-2008 09:06 AM
05-19-2008 11:28 AM
02-17-2009 03:40 PM
Hi,
I don't find these files SaveAsMatFile.vi Conv2Mat.vi in the posted link http://digital.ni.com/public.nsf/websearch/2f8ed0f588e06be1862565a90066e9ba?OpenDocument
Anyone can help please?
Thank you.
02-17-2009 03:50 PM
Hi,
You need to download the .zip file linked at the bottom of the document. That contains the files you need.
Regards,
John B.
AE Specialist - Test Products
National Instruments
02-18-2009 06:42 AM
Hi again,
The attached file in the page (.ZIP) cannot be opened (server cannot be found).
Thanks.
02-18-2009 09:31 AM
Hi,
It looks like that was not correctly linked. Here's the attachment until it is fixed. Sorry about that.
Regards,
John Bongaarts
AE Specialist - Test Products
National Instruments