08-14-2009 01:28 PM
Hello,
I am working on LabView(from last 2 weeks) and I simply want to know that how can I access the Labview files in Matlab? can some body just tell me in simple? or send me some example or tutorial about how to access the LabView file in matlab .
I shall be thanks full.
08-14-2009 01:47 PM
Are you referring to output files? Like data files? If so, then you will need to be more specific. What kind of data? You could simply generate text files using the File I/O functions. You could also generate binary files. You could also use TDMS.
Alternatively, you could use the Matlab Script Node to call your Matlab code and pass the data directly to the node without writing it out to a file.
08-14-2009 02:27 PM
Like when I use the Labview to acquire the data from the DAQ pci board then I get some files that can be data files and as I save them in text file then I will get just the binary numbers (as I attach the files aswell first two are from SE(signal express) and last one is from labview) , I was wondering that how can i run that files in the MATLAB
and is it also possible to run the matlab code in Labview if yes then How ?
thanks
08-14-2009 02:41 PM
I'm not sure what you mean by "running those files". Those are just text files, so you can just use Matlab's file I/O functions to read the files. That has nothing to do with LabVIEW. I am assuming you want to do this because you have some code on the Matlab side that you cannot run in LabVIEW. Otherwise, LabVIEW has lots of data processing and analysis functionality.
As far as running Matlab code inside of LabVIEW, you can use the Matlab Script Node. Depending on what functions you're using you can probably use the Mathscript node instead.
08-16-2009 07:30 AM
Dear smercurio_fc
Unfortunately I dont have the clear idea what you said in this replay about how I can genrate the binary files and what is the TDMS and how and why we use that (How we can benifit from the labview output files using Matlab?). But I just know to convert the Labview files in the text files format (as I sent you those as well ), yet. but thanks for all these replies , I will try to read all these links which you suggest me to read,
If you can just give me these answers in simple, I hope it wil be beneficial for me to understand the things.
BR
08-16-2009 08:41 AM
08-16-2009 09:52 AM
Mubi wrote:Dear smercurio_fc
Unfortunately I dont have the clear idea what you said in this replay about how I can genrate the binary files and what is the TDMS and how and why we use that (How we can benifit from the labview output files using Matlab?). But I just know to convert the Labview files in the text files format (as I sent you those as well ), yet. but thanks for all these replies , I will try to read all these links which you suggest me to read,
If you can just give me these answers in simple, I hope it wil be beneficial for me to understand the things.
BR
I don't know what else you really want me to say. You have text files. You want to read them in Matlab. There's nothing to convert. Simply use the file functions in Matlab to read the files. I can't give a simpler answer than that because there's nothing more to it, and this has to do with Matlab programming, not LabVIEW.
The only reason I mentioned binary files or TDMS files is if you were dealing with large amounts of data. In this case text files can be very large, and saving the data as binary is more efficient. However, the files you uploaded are quite small.
08-16-2009 11:20 AM
Mubi,
your case is not difficult. Your best bet is to save your data as a spreadsheet file or convert the existing one into a spreadsheet file, then use the "read from spreadsheet file to get a vector , and use that as an input to your MATLAB node.
Though, you can also directly read from the text file, but more work will be needed.
I have attached a pic of what I am trying to tell you.
Perhaps, if you explain what your MATLAB will actually do, I can give you more detailed info.