LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

matlab 2010 dll with LabVIEW 2010 (Both 32 bit)

I have a Matlab generated dll built with Matlab 2008b and it works fine with LabVIEW 2010 sp1 . If I recompile the code for the dll in Matlab 2010a it compiles fine just like in 2008b, however LabVIEW will not work with it.

 

Is there a known compatability issue with Matlab 2010 and if so, what about Matlab 2011

 

Thnaks much,

Adam

0 Kudos
Message 1 of 8
(3,833 Views)

When you compile matlab code, the LabVIEW can recognize the DLL? I thought you still need a wrapper DLL to pass data, because LabVIEW and Matlab hold different data types. 

 

Refer to this long post if you want to know how to create a wrapper DLL from VC.http://forums.ni.com/t5/LabVIEW/dll-matlab-an-LadVIEW/td-p/47127

 

I hope your approach works, that means there is no need to compile the DLL in VC again. 

0 Kudos
Message 2 of 8
(3,832 Views)

Sorry, I should have been specific...

 

When I said that labview works with my compiled matlab 2008 code, I ment to imply that the mfile dll and the wrapper dll are all working fine with labview when compiled with matlab 2008. Matlab 2010 seems to compile both the code dll and wrapper dll just fine, however labview will no longer initalize the M-file dll

 

More specifically the wrapper dll starts and passes the mclInitializeApplication fine, but will always fail the m-code initalize...

(ie always returns -2)

 

Also, I do have the correct version of the mcr for 2010 running

 

int

DLLlinkInit(void)

{

mclmcrInitialize();

if(!mclInitializeApplication(NULL,0))

{

//std::cerr << "Could not initialize MCR" << std::endl;return-1;

}

if(!TKlibInitialize()){

 

//fprintf(stderr,"Could not initialize the library.\n");return-2;

}

return0;

}

 

Adam

0 Kudos
Message 3 of 8
(3,829 Views)

Did you try 64-bit? I need both 32 and 64, but I am not sure whether 64 bit compile is possible yet. 

0 Kudos
Message 4 of 8
(3,826 Views)

Labview can't even recognize the dlls if they are compiled 64bit

0 Kudos
Message 5 of 8
(3,824 Views)

It seems that you have more experience on this Matlab to LabVIEW issue. 

 

With the Matlab DLL and the wrapper DLL loaded to LabVIEW, do you still need the MCR for each computer that you deploy your LabVIEW executables?

0 Kudos
Message 6 of 8
(3,786 Views)

Yes,

 

If the LabView containes a DLL that was generated directly from Matlab code, then all Matlab calls within the DLL are resolved with the MCR. Your LabView application

should not even start if you do not have the proper version of the MCR installed.

 

BTW...

 

The solution to LabView with Matlab 2010 dlls not working is to upgrade your Matlab to 2011a and all goes back to working...

 

 

A

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

Is this MCR a free download like the LabVIEW run time engine?

0 Kudos
Message 8 of 8
(3,772 Views)