| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Real-Time Workshop Embedded Coder |
| Contents | Index |
| Learn more about Real-Time Workshop Embedded Coder |
The C++ (Encapsulated) option does not support some Simulink model configuration options. Selecting C++ (Encapsulated) disables the following items in the Configuration Parameters dialog box:
Identifier format control subpane on the Symbols pane
Templates pane
The Templates pane parameter File customization template is not supported for C++ (Encapsulated) code generation.
Selecting C++ (Encapsulated) turns on the Templates pane option Generate an example main program but removes it from the Configuration Parameters dialog box. If desired, you can disable it using the command line parameter GenerateSampleERTMain.
Data Placement pane
Memory Sections pane
Among the data exchange interfaces available on the Interface pane of the Configuration Parameters dialog box, only the C API interface is supported for C++ (Encapsulated) code generation. If you select External mode or ASAP2, code generation fails with a validation error.
The I/O arguments style of step method specification supports single-rate models and multirate single-tasking models, but not multirate multitasking models.
The C++ (Encapsulated) option does not support use of the IncludeERTFirstTime model option to include the firstTime argument in the model_initialize function generated for an ERT-based models. (The IncludeERTFirstTime option is off by default except for models created with R2006a.) Also, the C++ (Encapsulated) option requires that the target selected for the model support firstTime argument control by setting the ERTFirstTimeCompliant target option, which all targets provided by The MathWorks do by default. In other words, the C++ (Encapsulated) option requires that the target option ERTFirstTimeCompliant is on and the model option IncludeERTFirstTime is off.
The Real-Time Workshop > Export Functions capability does not support C++ (Encapsulated) as the target language.
For a Stateflow chart that resides in a root model configured to use the I/O arguments step method function specification, and that uses a model root inport value or calls a subsystem that uses a model root inport value, you must do one of the following to generate code:
Clear the Execute (enter) Chart At Initialization check box in the Stateflow chart.
Insert a Signal Conversion block immediately after the root inport and select the Exclude this block from 'Block reduction' optimization check box in the Signal Conversion block parameters.
When building a referenced model that is configured to generate a C++ encapsulation interface:
You must use the I/O arguments step method style of the C++ encapsulated interface. The void-void step method style is not supported for referenced models.
You cannot use a C++ encapsulation interface in cases when a referenced model cannot have a combined output/update function. Cases include a model that
Has multiple sample times
Has a continuous sample time
Saves states
![]() | Sample M-Script for Configuring the Step Method for a Model Class | Replacing Math Functions and Operators Using Target Function Libraries | ![]() |

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 |