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

2 views (last 30 days)
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.

Accepted Answer

Kaustubha Govind
Kaustubha Govind on 7 May 2013
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.

More Answers (0)

Categories

Find more on Simulink Coder in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!