LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I write binary data in LabVIEW to a Matlab MAT-file

I wish to use LabVIEW v6.1 to write binary data to a MATLAB binary file (MAT-file, *.mat). My Matlab version is 6.5. Matlab will NOT be installed on the computers that are acquiring the data and writing to the data files, so a Matlab script node will not work in this application.

I have already searched LabVIEW support AND the Developer Zone, with only partial success. I did find one KnowledgeBase article Can I Import Data from MATLAB to LabVIEW or Vice-versa? on this subject. The example code in that article "LV40 to MAT file" does indeed create .mat files, but this seems to be wri
tten for use with a much older version of Matlab (version 4.0 and previous), and therefore will not handle a Matlab "Structured Array" data type, which was introduced in version 5.0. I am looking for an already written LabVIEW Library of routines to accomplish this, and I am willing to pay for a commercial product, if such a product exists.

~Tim
0 Kudos
Message 1 of 7
(4,885 Views)
I do not know of a commerical product. You have to dig through the Mathworks site for the structure of their .mat file. Once you have that, we will be able to help.
0 Kudos
Message 2 of 7
(4,885 Views)
Jeremy,

Already done. I've attached the document that describes the file structure. Thanks for the prompt reply!

Tim

~Tim
0 Kudos
Message 3 of 7
(4,885 Views)
I could still use an answer to this, if anyone has an answer.

Tim

~Tim
0 Kudos
Message 4 of 7
(4,885 Views)
The task you are asking is pretty simple, in concept. However, it will take many hours to implement. So the question is how much do you want to spend? Most of us charge by the hour.
0 Kudos
Message 5 of 7
(4,885 Views)
I could swing a couple hundred dollars, perhaps three. The hard part will be defining exactly what I need, since I have a very specific data structure in mind. Basically, I need routines that will convert an array of LV Waveforms, including some Waveform Attributes, into a Matlab "Structured Array" data type, then save that to a .mat file. I also need to include some text comments.

My need is immediate. Anyone wishing to explore the possibility of writing this code "for sale" should email me direct at tdvargo@sandia.gov, and leave me a phone number to contact you at.

Thanks!

~Tim
0 Kudos
Message 6 of 7
(4,885 Views)
Hello Tim,

I'm dealing with exactly the same problem.

My Solution is to use the C-functions for reading/writing mat-files provided with the MatLab distribution. I will try do generate a dll-library with this functions and I hope I can use the LabVIEW dll-interface to get this c-functions in the dll under LabVIEW running. If this solution fails I will try to generate a little help program which reads/writes the data from/to a mat-File by using commandline arguments.

But I still hope there is an much easier way to get a working solution, so I haven't start programming yet.
0 Kudos
Message 7 of 7
(4,885 Views)