| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Real-Time Workshop |
| Contents | Index |
| Learn more about Real-Time Workshop |
| On this page… |
|---|
The Real-Time Workshop product includes a variety of approaches for integrating legacy or custom (external) code with generated code. Legacy code is existing C or C++ hand code or code for environments that needs to be integrated with code generated by the Real-Time Workshop software. Custom code can be legacy code or any other user-specified lines of code that need to be included in the Real-Time Workshop build process. Collectively, legacy and custom code are called external code.
You can achieve code integration from either of two contexts. You can integrate
Code generated by the Real-Time Workshop software into an existing code base for a larger system. For example, you might want to use generated code as a plug-in function. For this type of integration, you should use the Real-Time Workshop Embedded Coder product. The Real-Time Workshop Embedded Coder documentation explains how to use entry points and header files to interface your existing code with generated code.
Existing code into code generated by the Real-Time Workshop software. This type of integration can be either block based or model based. Block-Based Integration and Model or Target-Based Integration list available code integration mechanisms based on various application requirements.
The following table lists available block-based integration mechanisms based on application requirements. The table also provides information on where to find details on how to apply each mechanism.
| If You Need or Prefer to... | Consider Using... | For Details, See... |
|---|---|---|
| User written S-Function blocks |
|
| S-Function Builder block | Information on the S-Function Builder block in the Simulink documentation |
| Real-Time Workshop Custom Code blocks |
S-Function blocks offer the most capable and flexible means of integrating code and specifying additional build information. Their use in a model carries the build information as well.
The following table lists available model or target-based integration mechanisms based on application requirements. The table also provides information on where to find details on how to apply each mechanism.
| If You Need or Prefer to... | Consider Using... | For Details, See... |
|---|---|---|
| Custom Code pane of the Configuration Parameters dialog box | |
| Custom target template makefile | Real-Time Workshop Embedded Coder documentation — details on makefiles |
Note It is also possible to affect the Real-Time Workshop build process by specifying libraries or sources in the Make command field on the Real-Time Workshop pane of the Configuration Parameters dialog box. This approach requires knowledge of the make variables used in a target template makefile and is not generally recommended. |
![]() | About External Code Integration | Making External Code Language Compatible With Generated Code | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |