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