C/C++ wrapper to invoke SIMULINK model/libraries in external software designs

조회 수: 1 (최근 30일)
Is it possible to use C/C++ wrapper functions to call SIMULINK models in an external environment such as Visual Studio or eclipse C++ software project?
The reason is that any modification to the original model doesn't need to be visitble outside. The updated model can still be accessible via wrapper function.
Could someone help me?

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2013년 6월 28일
It is possible to generate a standalone C/C++ shared library from your Simulink model if you have an Embedded Coder license, which you can then invoke from any C/C++ application.
However, it looks like what you want is to continue to run the model within the MATLAB environment, correct? If so, you can write MATLAB code to run the model using the Simulink command-line API, or more specifically, the sim command if you want to execute the model without any additional operations. You can then call the MATLAB code from a C/C++ application running on the same machine by using the MATLAB Engine interface.
  댓글 수: 2
Mohammed Manna
Mohammed Manna 2013년 7월 23일
Firstly, thanks for your explanation. What you are saying, if I understood correctly, is that the only way to do it is by calling MATLAB scripts from within my external C/C++ project. The MATLAB script will be running the models. But how am I going to use the functionality of the models. the sim command only runs the simulation of the model. But what I am after is the ability to use the model's functionality inside my external C/C++ application without the necessity code generation. I apologise if my original question did not have sufficient clarity.
Kaustubha Govind
Kaustubha Govind 2013년 7월 23일
Mohammed: Could you please provide examples of the model functionality that you're looking to use?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by