Guidelines to port Simulink Code to specific Target (Custom Machine)

조회 수: 3 (최근 30일)
Hi,
I have a Matlab S-function in Simulink which contains a wide ensemble of functions from Java functions to system commands (e.g.). I am opening a udp socket on my code.
serversock = java.net.ServerSocket(port);
[status, result] = system([cmd ' &'],'-echo');
I would like to generate C code and an executable for a specific target (non-standard Computer Machine, e.g. no Windows, no Mac, etc).
I understand I would have to do some customization for this. Could you give me an overview of the steps that I need to follow for this?
I have read some of the TLC and the Simulink Coder documentation.
I think I need to do this:
1) Code a Block TLC file to inline the Matlab S-Function. Is this possible with the functions I implement?
2) Create a System Target File (STF) to customize the code generation to fit the machine that I need to use.
Am I on the right track? I also have the same functionality of the simulink block on a regular m.file. Would you recommend using other toolboxes like Matlab Coder, Embedded Coder for this?
Thanks in advanced.

채택된 답변

Kaustubha Govind
Kaustubha Govind 2013년 5월 7일
Yes, you are correct on both points. You may want to refer to the documentation on Custom Targets to learn how to customize the code-generation and build process for your target.
Since you are using Java functions, I don't believe MATLAB Coder will be able to generate C code from your MATLAB functions (see functions supported for code generation). You will need to implement the same code manually in C, and write your block TLC to produce the same kind of C code.

추가 답변 (0개)

카테고리

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