01-21-2008 12:38 PM
01-21-2008 01:20 PM
They would still need to install the Matlab Component Runtime in order to use the DLL, so I don't know if that changes your situation.
@yw wrote:I wanted to use Matlab compiler to compile the matlab m script function into a c shared library .dll so that LabVIEW can call it without requiring Matlab installed on the PC.
01-22-2008 04:34 AM
I'm not sure what type mxArray would have in C syntax. I would guess however that Matlab would support datatype parameters that are more or less common standard C datatypes. Otherwise the whole Matlab DLL story wouldn't make that much sense I think.
@yw wrote:
Hello LabView developers,I used LabVIEW to call Matlab m script to implement matlab MPC successfully. I wanted to use Matlab compiler to compile the matlab m script function into a c shared library .dll so that LabVIEW can call it without requiring Matlab installed on the PC.I used MatLab R2007b with matlab compiler. I was able to generate a C shared library dll set successfully using mcc command.However, from the header file, I see that the inputs and outputs of the function prototype are in mxArray. I need to change this data type to whatever that LabView Call Library Function Node can recognize.I have followed a few examples in the forum, but none of them went through.I use LabView 8.5. I have Microsoft Visual C++ Version 6 and Microsoft Visual Studio 2005. The compiler is in C++. Should I use a C compiler only to generate the C wrapper dll so that Labview can recognize it in the Call Library Function Node?If anybody has gone through this successfully, I would like to learn from you on how to do it.Thanks,Kimberly
01-23-2008 02:08 PM
Hi Kimberly,
The only datatypes supported are the standard types listed as options in the call library function.
Workaround is to use the Matlab® node function but you would need to purchase a license or write a wrapper code to convert the datatype to a standard one, as you have tried.
I see that you have tried a few examples on the discussion forums, but there was a very extensive discussion about this exact application on the forums, with some user success:
http://forums.ni.com/ni/board/message?board.id=170&message.id=29793&view=by_date_ascending&page=1
I do like the example on MatLab's ® website: http://www.mathworks.com/support/solutions/data/1-PM4OX.html?1-PM4OX
Unfortunately, this is just a proprietary format that MatLab ® has and a lot of users are having the similar issue. It seems that there is no easy workaround, and at NI, because we have no MatLab ® software, I cannot test this out. Due to the variances in applications, MatLab ® versions, etc. its just a bit difficult.
01-24-2008 12:17 AM - edited 01-24-2008 12:19 AM
I'm sure there is a Matlab license somewhere at NI
@TMC-NI wrote:
Unfortunately, this is just a proprietary format that MatLab ® has and a lot of users are having the similar issue. It seems that there is no easy workaround, and at NI, because we have no MatLab ® software, I cannot test this out. Due to the variances in applications, MatLab ® versions, etc. its just a bit difficult.