NI Home > Community > NI Discussion Forums

LabVIEW

Showing results for 
Search instead for 
Do you mean 
Reply
Member
bharath_reddy
Posts: 42
0 Kudos

Error reading xls file

  Why the simulation is not accepting the data iam trying to give.

 Why Does the "Read Waveform From File.vi" Behave Differently in the Run-time Engine?

 what is the solution for this.Can you explain please.Iam also adding the vi file and the excel file I'm using.

 Regards
 Bharath
Knight of NI
Posts: 18,064
0 Kudos

Re: Error reading xls file

[ Edited ]
You cannot use Read Waveform From File to read an Excel spreadsheet. Read Waveform From File is designed to read files that were created using Write Waveforms To File.

Where did your data come from?


Message Edited by smercurio_fc on 04-25-2008 12:45 PM
Member
bharath_reddy
Posts: 42
0 Kudos

Re: Error reading xls file

Thanks for reply.
            
             My data is external.It is taken from one simualtion in matlab.
             How do i read that data that is in text or Excel format.
             Can you please tell me a way?
Bharath
Knight of NI
Posts: 18,064
0 Kudos

Re: Error reading xls file

[ Edited ]
If the data is in Excel then you need to use ActiveX. The easiest way to do this is to have the Matlab code save the data as a text file, using tabs between columns if you have more than one column, though your sample data shows only 1 column. Then just use the VI Read From Spreadsheet File. Note that "spreadsheet" doesn't refer to an Excel file - it refers to a spreadsheet-like formatted text file. That function returns a 2D array, since it assumes multiple columns. However, if you have just one column, then just use Index Array to get the first column:



Check the LabVIEW Help for more information on Read From Spreadsheet File.


Message Edited by smercurio_fc on 04-25-2008 01:09 PM
Knight of NI
Dennis_Knutson
Posts: 33,438
0 Kudos

Re: Error reading xls file

[ Edited ]

If you save the file as tab separated text, then the code below will read the file and display the waveform.



Message Edited by Dennis Knutson on 04-25-2008 12:15 PM
Knight of NI
Posts: 18,064
0 Kudos

Re: Error reading xls file

Bharath,

Note that Dennis is showing you a waveform graph, while the example I provided used a waveform chart, which is what you initially were using. Both are valid - you will need to decide which method is more appropriate for you.
Member
bharath_reddy
Posts: 42
0 Kudos

Re: Error reading xls file

Thanks for your valuable replies.
Dennis,where do i get the last block (you've written 'DBL' in it.).
I've been searching but i am missing it.
Knight of NI
Dennis_Knutson
Posts: 33,438
0 Kudos

Re: Error reading xls file

[ Edited ]

You don't know where to find a waveform graph?

 

Please spend some time at http://www.ni.com/academic/lv_training/how_learn_lv.htm

Message Edited by Dennis Knutson on 04-25-2008 12:42 PM



Message Edited by Dennis Knutson on 04-25-2008 12:44 PM
Member
bharath_reddy
Posts: 42
0 Kudos

Re: Error reading xls file

Hi Dennis,

                 I tried the simualtion you are given.It is giving the waveform but a portion of it  only showing. Any time only 1023 samples of data is coming. That too it is coming from 17111 to 18134.I tried to change all the axis and scaling even then it is not changing. I am attaching the text files with tabs inside the elements. Can you please explain me the reason or can you send me the spread sheet file you've given for the simulation.
 
 Thanks
 Bharath.


 
Knight of NI
altenbach
Posts: 27,023
0 Kudos

Re: Error reading xls file

[ Edited ]

We cannot see any of your images, because they point to your hard drive which is not public. Please attach images first.

Please attach your data file, so we can see why it reads only 1k points.



Message Edited by altenbach on 04-26-2008 09:16 AM

LabVIEW Champion . Do more with less code and in less time .