LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Export DLL from Matlab and import in Labview

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?

Arnold
0 Kudos
Message 1 of 8
(7,275 Views)

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

Regards,
Srikrishna


Message 2 of 8
(7,256 Views)

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.

0 Kudos
Message 3 of 8
(7,229 Views)

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

0 Kudos
Message 4 of 8
(7,096 Views)

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.

0 Kudos
Message 5 of 8
(7,092 Views)

Thanks a lot !!

regards,

taraq

0 Kudos
Message 6 of 8
(7,041 Views)

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!

0 Kudos
Message 7 of 8
(6,719 Views)

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.

0 Kudos
Message 8 of 8
(6,701 Views)