12-23-2010 01:19 PM
I have this issue now, someone wrote a large package of .m codes (many files include several user-defined m-file functions) in Matlab for an algorithm, I'd like to integrate them into my Labview environment. My strategy used to use Matlab node and Mathscript node. Then I found Mathscript doesn't really compatible to the Matlab syntax so that when I import the m file, it gives me tons of errors so I can't run the program. Matlab node can import codes, but it runs very slow. So I'm thinking of the DLL solution.
I checked some threads on this forum, very helpful, but they said I need Labview, Matlab and VC compiler. So I don't have VC compiler on my computer, I was wondering does Matlab R2009b can export DLL and Labview 2009 can import without VC compiling in the middle? Any idea or suggestion?
12-24-2010 01:04 AM
Hi mugger,
Since you have matlab and LabVIEW both installed in your machine,then i can suggest you can use Script Nodes(mathematics Pallette) where you can communicate with Matlab through that node and get the output from any matlab function.Currently Labview Can import DLLs only if they are made using Visual Studio(VC).
Thanks and regards,
srikrishnaNF
12-26-2010 12:38 PM
Even if you had Visual C++ (you can get a free "Express" version from Microsoft), it wouldn't help you in this case. To compile the .m files into a DLL you need the Matlab compiler. Do you have that? If not, you will need to purchase a license. I don't know the specifics of how the Matlab compiler works, but if it has an option to create function calls using "C" calling convention you should choose that.
02-03-2011 10:30 AM
Hi mugger,
I want import Matlab code into labview and work it on for data acquisition. So can please provide me some threads or links where it explains step by step how to import dll function or matlab code into labview.
thanks
02-03-2011 10:34 AM
http://www.ni.com/analysis/matlab.htm
LabVIEW has an Import Shared Library wizard for importing DLLs. The LabVIEW Help explains how to use it. Whether or not it will work with a Matlab DLL I cannot say since I've never tried it. As I pointed out, you need to have the Matlab compiler in order to create a Matlab DLL.
02-15-2011 08:33 AM
Thanks a lot !!
regards,
taraq
06-20-2011 10:03 AM
Hi Taraq,
did you succeed in creating the Matlab DLL and use them in LabVIEW?
I'm having a bad time trying to achieve this...
any help on this would be greatly appreciated.
Best regards!
06-21-2011 05:21 PM
You can use the "Call Library Function Node" in LabVIEW to import a DLL. Creating the DLL should be done externally to LabVIEW. For information on how to configure your Call Library Function Node, check out this link.