mharoon Posted August 7, 2006 Report Share Posted August 7, 2006 How can I call matlab dlls in LV? Is it torture? Quote Link to comment
Vincent C Posted August 18, 2006 Report Share Posted August 18, 2006 If the dll is like any other dlls, you should not have a problem. Also note that with LabVIEW 8.20, there is a DLL import Wizard to easily create VIs from the functions in a dll. This will reduce the development time by ALOT!!!! Take a look at this tutorial: Integrating External Code With The Shared Library Import Wizard http://zone.ni.com/devzone/conceptd.nsf/we...6257184006BBB7A Hope this helps, Vincent Quote Link to comment
Aitor Solar Posted August 18, 2006 Report Share Posted August 18, 2006 And if it's an ActiveX dll, register it and call it like an ActiveX object. The same would apply to .NET Matlab dlls, but for some reason I haven't be able to call them from LV yet. Saludos, Aitor Quote Link to comment
cosmin Posted August 18, 2006 Report Share Posted August 18, 2006 And if it's an ActiveX dll, register it and call it like an ActiveX object. The same would apply to .NET Matlab dlls, but for some reason I haven't be able to call them from LV yet.Saludos, Aitor Hello, i don't think you can call functions from matlab built dll directly in labview. You must create a wrapper dll, which initialize the mxArray's. cosmin Quote Link to comment
cosmin Posted August 22, 2006 Report Share Posted August 22, 2006 How can I call matlab dlls in LV? Is it torture? Hi, I've taken a little of my time to put something together, so you can get started. Look in the attachment for VI who use magic function from Matlab. mymagic.dll was created with matlab compiler, and Lmagic.dll is a wrapper for calling the magic function in Labview. Actually the magic.m is an example in Matlab help about how to create shared libraries with Matlab compiler. P.S. the test.vi has a bug in it (I do not have time to look deeper), it works only once. It seems that the mclTerminateApplication function does not terminate de mclapp or is something else. Look in the Mathworks docs for some more info. You have to exit labview for the mclInitializeApplication to work again. cosmin Download File:post-4089-1156256245.zip Quote Link to comment
cosmin Posted September 4, 2006 Report Share Posted September 4, 2006 P.S. the test.vi has a bug in it (I do not have time to look deeper), it works only once. It seems that the mclTerminateApplication function does not terminate de mclapp or is something else. Look in the Mathworks docs for some more info. You have to exit labview for the mclInitializeApplication to work again.cosmin hi, actually the issue with mclInitializeApplication and mclTerminateApplication is not a bug. Mathworks web site says that mclInitializeApplication must be called only once per application. So in our case that application is Labview.exe. In the wrapper dll it must be created an init function and close function, to call only once mclInitializeApplication and mclTerminateApplication cosmin Quote Link to comment
bellander Posted September 13, 2006 Report Share Posted September 13, 2006 hi,actually the issue with mclInitializeApplication and mclTerminateApplication is not a bug. Mathworks web site says that mclInitializeApplication must be called only once per application. So in our case that application is Labview.exe. In the wrapper dll it must be created an init function and close function, to call only once mclInitializeApplication and mclTerminateApplication cosmin I had the same problem and solved with a VI server calling the dll, but in 8.20 u have the option to call a dll dynamiclly if i Quote Link to comment
Rammer Posted March 19, 2008 Report Share Posted March 19, 2008 QUOTE (bellander @ Sep 13 2006, 05:27 AM) I had the same problem and solved with a VI server calling the dll, but in 8.20 u have the option to call a dll dynamiclly if i´m not misstaken. Anyway the program was very unstable andi therefor contacted Mathworks support which told me that they had a bug in the init and terminate function when compiling to a dll. Did you ever get Mathworks to send you a fix? I am now trying and seeing the same problem. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.