Thread Subject: Accessing mexw32 from C/C++

Subject: Accessing mexw32 from C/C++

From: Markus

Date: 4 Dec, 2007 16:31:19

Message: 1 of 3

A lot of stuff is written about how to access mexw32 files
from MatLab/Simulink. However I haven't found anything about
accessing mexw32 (created by RTW) from C/C++. A simple try
already failed at the LoadLibrary function. Has anybody done
this before?

Thanks
    Markus

Subject: Accessing mexw32 from C/C++

From: Fred Smith

Date: 5 Dec, 2007 06:14:22

Message: 2 of 3


Hi Markus,

If you are referring to MEX-functions generated by the EMLMEX command, then
these are not designed to be used outside the MATLAB environment. If you
have a Real-Time Workshop license you can use EMLC with the -T RTW:lib to
generate a standalone library. This can be linked into your application
however you wish. Of course, your library won't be able make calls using
eml.extrinsi in this case.

-Fred


"Markus " <markus.schiefele@takata.com> wrote in message
news:fj3vcn$lpn$1@fred.mathworks.com...
>A lot of stuff is written about how to access mexw32 files
> from MatLab/Simulink. However I haven't found anything about
> accessing mexw32 (created by RTW) from C/C++. A simple try
> already failed at the LoadLibrary function. Has anybody done
> this before?
>
> Thanks
> Markus


Subject: Accessing mexw32 from C/C++

From: Markus

Date: 5 Dec, 2007 15:46:01

Message: 3 of 3

Hi Fred,

Thanks for your answer. What I actually did is right
clicking on a subsystem and go to Real Time
Workshop|Generate S-Function ... I would like to acces the
mexw32 file, created this way in MSVC++ 7.0. With MatLab
2007b, not even the LoadLibray function worked. I also have
a 2006a MatLab Version on my computer, and the LoadLibrary
function worked, with the Mexw32 file created with
MatLab/Simulink 2006a.
I was hoping to find the usual level 2 S-function interface
(i.e. mdlInitializeSizes, mdlInitializeSampleTimes,
mdlStart, mdlOutputs, mdlUpdate and mdlTerminate) however
the GetProcAddress calls with the previously mentioned
functions all gave a NULL pointer back, i.e. could not find
those functions.
What I need now is a description of the interface of a
mexw32 file created with RTW.
If you're interested, I'll be happy to send you the code I
have so far.

Thanks
Markus


Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
mexw32 Markus 4 Dec, 2007 11:35:03
cc Markus 4 Dec, 2007 11:35:03
rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com