| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Real-Time Workshop |
| Contents | Index |
| Learn more about Real-Time Workshop |
The Real-Time Workshop Interface pane includes the following parameters when the Real-Time Workshop product is installed on your system and you select a GRT-based target.

The Real-Time Workshop Interface pane includes the following parameters when the Real-Time Workshop product is installed on your system and you select an ERT-based target. ERT-based target parameters require a Real-Time Workshop Embedded Coder license when generating code.

Select the target software environment, output variable name modifier, and data exchange interface.
Specify a target-specific math library for your model.
Default: C89/C90 (ANSI)
Generates calls to the ISO®/IEC 9899:1990 C standard math library for floating-point functions.
Generates calls to the ISO/IEC 9899:1999 C standard math library.
Generates calls to the GNU® gcc math library, which provides C99 extensions as defined by compiler option -std=gnu99.
Note Additional Target function library values may be listed if you have created and registered target function libraries with the Real-Time Workshop Embedded Coder software, or if you have licensed any Link or Target products. For more information on the Target function library values for Link or Target products, see your Link or Target product documentation. |
Before setting this parameter, verify that your compiler supports the library you want to use. If you select a parameter value that your compiler does not support, compiler errors can occur.
| Parameter: GenFloatMathFcnCalls |
| Type: string |
| Value: 'ANSI_C' | 'C99 (ISO)' | 'GNU99 (GNU)' |
| Default: 'ANSI_C' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | Any valid library |
| Safety precaution | No impact |
Specify the location for generating utility functions.
Default: Auto
Operates as follows:
When the model contains Model blocks, place utilities within the slprj/target/_sharedutils directory.
When the model does not contain Model blocks, place utilities in the build directory (generally, in model.c or model.cpp).
Directs code for utilities to be placed within the slprj directory in your working directory.
| Parameter: UtilityFuncGeneration |
| Type: string |
| Value: 'Auto' | 'Shared location' |
| Default: 'Auto' |
| Application | Setting |
|---|---|
| Debugging | Shared location (GRT) No impact (ERT) |
| Traceability | Shared location (GRT) No impact (ERT) |
| Efficiency | Shared location |
| Safety precaution | No impact |
Specify whether to generate floating-point data and operations.
Default: On (GUI), 'off' (command-line)
Generates floating-point data and operations.
Generates pure integer code. If you clear this option, an error occurs if the code generator encounters floating-point data or expressions. The error message reports offending blocks and parameters.
This parameter only appears for ERT-based targets.
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
Selecting this parameter enables Support: non-finite numbers and clearing this parameter disables Support: non-finite numbers.
This parameter must be the same for top-level and referenced models.
| Parameter: PurelyIntegerCode |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
Note The command-line values are reverse of the settings values. Therefore, 'on' in the command line corresponds to the description of "Off" in the settings section, and 'off' in the command line corresponds to the description of "On" in the settings section. |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | Off (GUI), 'on' (command-line) — for integer only |
| Safety precaution | No impact |
Specify whether to generate and maintain integer counters for absolute and elapsed time values.
Default: on
Generates and maintains integer counters for blocks that require absolute or elapsed time values. Absolute time is the time from the start of program execution to the present time. An example of elapsed time is time elapsed between two trigger events.
If you select this option and the model does not include blocks that use time values, the target does not generate the counters.
Does not generate integer counters to represent absolute or elapsed time values. If you do not select this option and the model includes blocks that require absolute or elapsed time values, an error occurs during code generation.
This parameter only appears for ERT-based targets.
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
You must select this parameter if your model includes blocks that require absolute or elapsed time values.
| Parameter: SupportAbsoluteTime |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'on' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | Off |
| Safety precaution | Off |
Specify whether to generate nonfinite data and operations.
Default: on
Generates nonfinite data (for example, NaN and Inf) and related operations.
Does not generate nonfinite data and operations. If you clear this option, an error occurs if the code generator encounters nonfinite data or expressions. The error message reports offending blocks and parameters.
This parameter only appears for ERT-based targets.
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
This parameter is enabled by Support: floating-point numbers.
This parameter must be the same for top-level and referenced models.
| Parameter: SupportNonFinite |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'on' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | Off |
| Safety precaution | Off |
Specify whether to generate code for blocks that use continuous time.
Default: off
Generates code for blocks that use continuous time.
Does not generate code for blocks that use continuous time. If you do not select this option and the model includes blocks that use continuous time, an error occurs during code generation.
This option only appears for ERT-based targets.
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
This option must be on if your model includes blocks that require absolute or elapsed time values.
This option must be off when generating an S-function wrapper for an ERT target; the code generator does not support continuous time for this target scenario.
If you have customized ert_main.c or .cpp to read model outputs after each base-rate model step, be aware that selecting the options Support: continuous time and Single output/update function together may cause output values read from ert_main for a continuous output port to differ from the corresponding output values in the model's logged data. This is because, while logged data is a snapshot of output at major time steps, output read from ert_main after the base-rate model step potentially reflects intervening minor time steps. To eliminate the discrepancy, either separate the generated output and update functions (clear the Single output/update function option) or place a Zero-Order Hold block before the continuous output port.
| Parameter: SupportContinuousTime |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | Off |
| Safety precaution | Off |
Specify whether to generate complex data and operations.
Default: on
Generates complex numbers and related operations.
Does not generate complex data and related operations. If you clear this option, an error occurs if the code generator encounters complex data or expressions. The error message reports offending blocks and parameters.
This parameter only appears for ERT-based targets.
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
This parameter must be the same for top-level and referenced models.
| Parameter: SupportComplex |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | Off (for real only) |
| Safety precaution | No impact |
Specify whether to generate code for noninlined S-functions.
Default: Off
Generates code for noninlined S-functions.
Does not generate code for noninlined S-functions. If this parameter is off and the model includes a noninlined S-function, an error occurs during the build process.
Inlining S-functions is highly advantageous in production code generation, for example, for implementing device drivers. In such cases, clear this option to enforce use of inlined S-functions for code generation.
Noninlined S-functions require additional memory and computation resources, and can result in significant performance issues. Consider using an inlined S-function when efficiency is a concern.
This parameter only appears for ERT-based targets.
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
Selecting this parameter also selects Support: floating-point numbers and Support: non-finite numbers. If you clear Support: floating-point numbers or Support: non-finite numbers, a warning is displayed during code generation because these parameters are required by the S-function interface.
| Parameter: SupportNonInlinedSFcns |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | Off |
| Safety precaution | Off |
Specify whether to generate code for models that use variable-size signals.
Default: Off
Generates code for models that use variable-size signals.
Does not generate code for models that use variable-size signals. If this parameter is off and the model uses variable-size signals, an error occurs during code generation.
This parameter only appears for ERT-based targets
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
| Parameter: SupportVariableSizeSignals |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | Off |
| Safety precaution | Off |
Specify whether to use system-defined or user-defined type definitions for multiword data types in generated code.
Default: System defined
Use the default system type definitions for multiword data types in generated code. During code generation, if multiword usage is detected, multiword types will be generated into the file rtwtypes.h.
Allows you to control how multiword type definitions are handled during the code generation process. Selecting this value enables the associated parameter Maximum word length, which allows you to specify a maximum word length, in bits, for which the code generation process will generate multiword types into the file rtwtypes.h. The default maximum word length is 256. If you select 0, no multiword types are generated into the file rtwtypes.h, which provides you complete control over type definitions for multiword data types in generated code.
This parameter only appears for ERT-based targets.
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
Selecting the value User defined for this parameter enables the associated parameter Maximum word length.
| Parameter: ERTMultiwordTypeDef |
| Type: string |
| Value: 'System defined' | 'User defined' |
| Default: 'System defined' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | Specifying User defined and a low value for Maximum word length reduces the size of the generated file rtwtypes.h |
| Safety precaution | Use default |
Specify a maximum word length, in bits, for which the code generation process will generate system-defined multiword types
Default: 256
Specify a maximum word length, in bits, for which the code generation process will generate multiword types into the file rtwtypes.h. All multiword types up to and including this number of bits will be generated. If you select 0, no multiword types are generated into the file rtwtypes.h, which provides you complete control over type definitions for multiword data types in generated code.
This parameter only appears for ERT-based targets.
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
This parameter is enabled by selecting the value User defined for the parameter Multiword type definitions.
| Parameter: ERTMaxMultiwordLength |
| Type: integer |
| Value: Any valid quantity of bits representing a word size |
| Default: 256 |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | Smaller values reduce the size of the generated file rtwtypes.h |
| Safety precaution | Use default |
Specify whether to generate model function calls compatible with the main program module of the GRT target.
Default: off
Generates model function calls that are compatible with the main program module of the GRT target (grt_main.c or grt_main.cpp).
This option provides a quick way to use ERT target features with a GRT-based custom target that has a main program module based on grt_main.c or grt_main.cpp.
Disables the GRT compatible call interface.
The following are unsupported:
Data type replacement
Nonvirtual subsystem option Function with separate data
This parameter only appears for ERT-based targets with Language set to C or C++ (not C++ (Encapsulated)).
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
Selecting this parameter also selects the required option Support: floating-point numbers. If you subsequently clear Support: floating-point numbers, an error is displayed during code generation.
Selecting this parameter disables the incompatible option Single output/update function. Clearing this parameter enables Single output/update function.
| Parameter: GRTInterface |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | Off |
| Efficiency | Off |
| Safety precaution | Off |
Support for Continuous Time Blocks, Continuous Solvers, and Stop Time
Specify whether to generate the model_step function.
Default: on
Generates the model_step function for a model. This function contains the output and update function code for all blocks in the model and is called by rt_OneStep to execute processing for one clock period of the model at interrupt level.
Does not combine output and update function code for model blocks in a single function, and instead generates the code in separate model_output and model_update functions.
Errors or unexpected behavior can occur if a Model block is part of a cycle, the Model block is a direct feedthrough block, and an algebraic loop results. See Model Blocks and Direct Feedthrough for details.
This option only appears for ERT-based targets with Language set to C or C++ (not C++ (Encapsulated)).
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
This option and GRT compatible call interface are mutually incompatible and cannot both be selected through the GUI. Selecting GRT compatible call interface disables this option and clearing GRT compatible call interface enables this option.
When you use this option, you must clear the option Minimize algebraic loop occurrences on the Model Referencing pane.
If you have customized ert_main.c or .cpp to read model outputs after each base-rate model step, be aware that selecting the options Support: continuous time and Single output/update function together may cause output values read from ert_main for a continuous output port to differ from the corresponding output values in the model's logged data. This is because, while logged data is a snapshot of output at major time steps, output read from ert_main after the base-rate model step potentially reflects intervening minor time steps. To eliminate the discrepancy, either separate the generated output and update functions (clear the Single output/update function option) or place a Zero-Order Hold block before the continuous output port.
| Parameter: CombineOutputUpdateFcns |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'on' |
| Application | Setting |
|---|---|
| Debugging | On |
| Traceability | On |
| Efficiency | On |
| Safety precaution | On |
Specify whether to generate the model_terminate function.
Default: on
Generates a model_terminate function. This function contains all model termination code and should be called as part of system shutdown.
Does not generate a model.terminate function. Suppresses the generation of this function if you designed your application to run indefinitely and does not require a terminate function.
This parameter only appears for ERT-based targets.
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
This parameter must be the same for top-level and referenced models.
| Parameter: IncludeMdlTerminateFcn |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'on' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | Off |
| Safety precaution | Off |
Specify whether to generate reusable, reentrant code.
Default: off
Generates reusable, multi-instance code that is reentrant. The code generator passes model data structures (root-level inputs and outputs, block states, parameters, and external outputs) in, by reference, as arguments to model_step and other the model entry point functions. The data structures are also exported with model.h. For efficiency, the code generator passes in only data structures that are used. Therefore, when you select this option, the argument lists generated for the entry point functions vary according to model requirements.
Does not generate reusable code. Model data structures are statically allocated and accessed by model entry point functions directly in the model code.
Entry points are exported with model.h. To call the entry-point functions from hand-written code, add an #include model.h directive to the code. If this option is selected, you must examine the generated code to determine the calling interface required for these functions.
When this option is selected, the code generator generates a pointer to the real-time model object (model_M).
In some cases, when this option is selected, the code generator might generate code that compiles but is not reentrant. For example, if any signal, DWork structure, or parameter data has a storage class other than Auto, global data structures are generated.
This parameter only appears for ERT-based targets with Language set to C or C++ (not C++ (Encapsulated)).
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
This parameter enables Reusable code error diagnostic and Pass root-level I/O as.
You must clear this option if you are using:
The static ert_main.c module, rather than generating a main program
The model_step function prototype control capability
The subsystem parameter Function with separate data
A subsystem that
Has multiple ports that share the same source
Has a port used by multiple instances has different sample times, data types, complexity, frame status, or dimension across the instances
Has output marked as a global signal
For each instance contains identical blocks with different names or parameter settings
This parameter has no effect on code generated for function-call subsystems.
| Parameter: MultiInstanceERTCode |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'on' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | On (for single instance) |
| Safety precaution | No impact |
Select the severity level for diagnostics displayed when a model violates requirements for generating reusable code.
Default: Error
Proceed with build without displaying a diagnostic message.
Proceed with build after displaying a warning message.
Abort build after displaying an error message.
Under certain conditions, the Real-Time Workshop Embedded Coder software might
Generate code that compiles but is not reentrant. For example, if signal, DWork structure, or parameter data has a storage class other than Auto, global data structures are generated.
Be unable to generate valid and compilable code. For example, if the model contains an S-function that is not code-reuse compliant or a subsystem triggered by a wide function-call trigger, the coder generates invalid code, displays an error message, and terminates the build.
This parameter only appears for ERT-based targets with Language set to C or C++ (not C++ (Encapsulated)).
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
This parameter is enabled by Generate reusable code.
| Parameter: MultiInstanceErrorCode |
| Type: string |
| Value: 'None' | 'Warning' | 'Error' |
| Default: 'Error' |
| Application | Setting |
|---|---|
| Debugging | Warning or Error |
| Traceability | No impact |
| Efficiency | None |
| Safety precaution | No impact |
Control how root-level model input and output are passed to the model_step function.
Default: Individual arguments
Passes each root-level model input and output value to model_step as a separate argument.
Packs all root-level model input into a struct and passes struct to model_step as an argument. Similarly, packs root-level model output into a second struct and passes it to model_step.
This parameter only appears for ERT-based targets with Language set to C or C++ (not C++ (Encapsulated)).
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
This parameter is enabled by Generate reusable code.
| Parameter: RootIOFormat |
| Type: string |
| Value: 'Individual arguments' | 'Structure reference' |
| Default: 'Individual arguments' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | No impact |
| Safety precaution | No impact |
Specify whether to generate the block parameter structure as a public, private, or protected data member of the C++ model class.
Default: private
Generates the block parameter structure as a public data member of the C++ model class.
Generates the block parameter structure as a private data member of the C++ model class.
Generates the block parameter structure as a protected data member of the C++ model class.
This parameter appears only for ERT-based targets with Language set to C++ (Encapsulated).
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
| Parameter: ParameterMemberVisibility |
| Type: string |
| Value: 'public' | 'private' | 'protected' |
| Default: 'private' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | No impact |
| Safety precaution | protected |
Configuring Code Interface Options
Specify whether to generate internal data structures such as Block I/O, DWork vectors, Run-time model, Zero-crossings, and continuous states as public, private, or protected data members of the C++ model class.
Default: private
Generates internal data structures as public data members of the C++ model class.
Generates internal data structures as private data members of the C++ model class.
Generates internal data structures as protected data members of the C++ model class.
This parameter appears only for ERT-based targets with Language set to C++ (Encapsulated).
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
| Parameter: InternalMemberVisibility |
| Type: string |
| Value: 'public' | 'private' | 'protected' |
| Default: 'private' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | No impact |
| Safety precaution | protected |
Configuring Code Interface Options
Specify whether to generate access methods for block parameters for the C++ model class.
Default: None
Does not generate access methods for block parameters for the C++ model class.
Generates noninlined access methods for block parameters for the C++ model class.
Generates inlined access methods for block parameters for the C++ model class.
This parameter appears only for ERT-based targets with Language set to C++ (Encapsulated).
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
| Parameter: GenerateParameterAccessMethods |
| Type: string |
| Value: 'None' | 'Method' | 'Inlined method' |
| Default: 'None' |
| Application | Setting |
|---|---|
| Debugging | Inlined method |
| Traceability | Inlined method |
| Efficiency | Inlined method |
| Safety precaution | None |
Configuring Code Interface Options
Specify whether to generate access methods for internal data structures, such as Block I/O, DWork vectors, Run-time model, Zero-crossings, and continuous states, for the C++ model class.
Default: None
Does not generate access methods for internal data structures for the C++ model class.
Generates noninlined access methods for internal data structures for the C++ model class.
Generates inlined access methods for internal data structures for the C++ model class.
This parameter appears only for ERT-based targets with Language set to C++ (Encapsulated).
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
| Parameter: GenerateInternalMemberAccessMethods |
| Type: string |
| Value: 'None' | 'Method' | 'Inlined method' |
| Default: 'None' |
| Application | Setting |
|---|---|
| Debugging | Inlined method |
| Traceability | Inlined method |
| Efficiency | Inlined method |
| Safety precaution | None |
Configuring Code Interface Options
Specify whether to generate access methods for root-level I/O signals for the C++ model class.
Note This parameter affects generated code only if you are using the default (void-void style) step method for your model class; not if you are explicitly passing arguments for root-level I/O signals using an I/O arguments style step method. For more information, see Passing No Arguments (void-void) and Passing I/O Arguments. |
Default: None
Does not generate access methods for root-level I/O signals for the C++ model class.
Generates noninlined access methods for root-level I/O signals for the C++ model class.
Generates inlined access methods for root-level I/O signals for the C++ model class.
This parameter appears only for ERT-based targets with Language set to C++ (Encapsulated).
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
| Parameter: GenerateExternalIOAccessMethods |
| Type: string |
| Value: 'None' | 'Method' | 'Inlined method' |
| Default: 'None' |
| Application | Setting |
|---|---|
| Debugging | Inlined method |
| Traceability | Inlined method |
| Efficiency | Inlined method |
| Safety precaution | None |
Configuring Code Interface Options
Specify whether to generate a destructor for the C++ model class.
Default: on
Generates a destructor for the C++ model class.
Does not generate a destructor for the C++ model class.
This parameter appears only for ERT-based targets with Language set to C++ (Encapsulated).
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
| Parameter: GenerateDestructor |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'on' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | No impact |
| Safety precaution | Off |
Configuring Code Interface Options
Specify whether generated code uses the operator new, during model object registration, to instantiate objects for referenced models configured with a C++ encapsulation interface.
Default: off
Generates code that uses dynamic memory allocation to instantiate objects for referenced models configured with a C++ encapsulation interface. Specifically, during instantiation of an object for the top model in a model reference hierarchy, the generated code uses new to instantiate objects for referenced models.
Selecting this option frees a parent model from having to maintain information about submodels beyond its direct children.
Does not generate code that uses new to instantiate referenced model objects.
Clearing this option means that a parent model maintains information about all of its submodels, including its direct and indirect children.
This parameter appears only for ERT-based targets with Language set to C++ (Encapsulated).
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
| Parameter: UseOperatorNewForModelRefRegistration |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | On |
| Safety precaution | Off |
Configuring Code Interface Options
Generate preprocessor conditional directives globally for a model or locally for each Model block with variant models.
Default: Use local settings
Generates preprocessor conditional directives based on the value of the Generate preprocessor conditionals parameter on the Model block parameters dialog. If you select the Generate preprocessor conditionals parameter in the Model block parameters dialog, the generated code contains preprocessor conditional directives for all variant models of that Model block. If you do not select this parameter for a Model block, code is generated for the active variant model.
Generates preprocessor conditional directives for all variant models of the Model blocks. Disables the Generate preprocessor conditionals parameter in the Model block parameters dialog.
Only generates code for the active variant model of the Model block. Disables the Generate preprocessor conditionals parameter in the Model block parameters dialog for all Model blocks.
For generating preprocessor directives we recommend the following settings:
Select the Inline parameters parameter on the Optimization pane of the Configuration Parameters dialog box.
Deselect the Ignore custom storage classes parameter on the Real-Time Workshop pane of the Configuration Parameters dialog.
This parameter only appears for ERT-based targets.
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
Setting this parameter to Use local settings enables Generate preprocessor conditionals parameter on the Model block parameters dialog.
Setting this parameter to Enable all or Disable all disables the Generate preprocessor conditionals check box on the Model block parameters dialog.
Setting this parameter to Enable all sets the Selected variant control on the Model block parameter dialog to (derive from conditions).
| Parameter: GeneratePreprocessorConditionals |
| Type: string |
| Value: 'Use local settings' | 'Enable all' | 'Disable all' |
| Default: 'Use local settings' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | No impact |
| Safety precaution | No impact |
Specify whether to log or monitor error status.
Default: off
Omits the error status field from the generated real-time model data structure rtModel. This option reduces memory usage.
Be aware that selecting this option can cause the code generator to omit the rtModel data structure from generated code.
Includes an error status field in the generated real-time model data structure rtModel. You can use available macros to monitor the field for error message data or set it with error message data.
This parameter appears only for ERT-based targets.
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
This parameter is cleared if you select the incompatible option MAT-file logging. If you subsequently select this parameter, code generation displays an error.
Selecting this parameter clears Support: continuous time.
If your application contains multiple integrated models, the setting of this option must be the same for all of the models to avoid unexpected application behavior. For example, if you select the option for one model but not another, an error status might not get registered by the integrated application.
| Parameter: SuppressErrorStatus |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
| Application | Setting |
|---|---|
| Debugging | Off |
| Traceability | No impact |
| Efficiency | On |
| Safety precaution | On |
Click the Configure Model Functions button to open the Model Interface dialog box. In this dialog box, you can specify whether the code generator uses default model_initialize and model_step function prototypes or model-specific C prototypes. Based on your selection, you can preview and modify the function prototypes.
This parameter appears only for ERT-based targets with Language set to C or C++ (not C++ (Encapsulated)).
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
Click the Configure C++ Encapsulation Interface button to open the Configure C++ encapsulation interface dialog box. In this dialog box, you can customize the C++ class interface for your model code. Based on your selections, you can preview and modify the model-specific C++ encapsulation interface.
This parameter appears only for ERT-based targets with Language set to C++ (Encapsulated).
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
Specify whether to generate an S-function block.
Default: off
Generates an S-function block to represent the model or subsystem. The coder generates an inlined C or C++ MEX S-function wrapper that calls existing hand-written code or code previously generated by the Real-Time Workshop software from within the Simulink product. S-function wrappers provide a standard interface between the Simulink product and externally written code, allowing you to integrate your code into a model with minimal modification.
When this option is selected, the Real-Time Workshop software:
Generates the S-function wrapper file model_sf.c (or .cpp) and places it in the build directory.
Builds the MEX-file model_sf.mexext and places it in your working directory.
Creates and opens an untitled model containing the generated S-Function block.
Does not generate an S-function block.
This parameter only appears for ERT-based targets.
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
| Parameter: GenerateErtSFunction |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
| Application | Setting |
|---|---|
| Debugging | On |
| Traceability | No impact |
| Efficiency | No impact |
| Safety precaution | No impact |
Specify whether to allow portability across host and target processors that support different word sizes.
Default: off
Generates conditional processing macros that support compilation of generated code on a processor that supports a different word size than the target processor on which production code is intended to run (for example, a 32-bit host and a 16-bit target. This allows you to use the same generated code for both software-in-the-loop (SIL) testing on the host platform and production deployment on the target platform.
Does not generate portable code.
This parameter only appears for ERT-based targets.
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
When you use this parameter, you should:
Select Create Simulink (S-Function) block
Set Emulation hardware on the Hardware Implementation pane to None
| Parameter: PortableWordSizes |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
| Application | Setting |
|---|---|
| Debugging | On |
| Traceability | On |
| Efficiency | Off |
| Safety precaution | No impact |
Specify whether to enable MAT-file logging.
Default: off
Enables MAT-file logging. When you select this option, the generated code saves to MAT-files any data specified in the Configuration Parameters > Data Import/Export Pane > Save to workspace subpane, and the data specified by any To Workspace blocks. See Data Import/Export Pane and To Workspace. In simulation, this data would be written to the MATLAB workspace, as described in Exporting Data to the MATLAB Workspace, but setting MAT-file logging redirects the data to a MAT-file instead. The file is named model.mat, where model is the name of your model.
Disables MAT-file logging. Clearing this option has the following benefits:
Eliminates overhead associated with supporting a file system, which typically is not needed for embedded applications
Eliminates extra code and memory usage required to initialize, update, and clean up logging variables
Under certain conditions, eliminates code and storage associated with root output ports
Omits the comparison between the current time and stop time in the model_step, allowing the generated program to run indefinitely, regardless of the stop time setting
This parameter only appears for ERT-based targets and the Tornado® target.
This parameter requires a Real-Time Workshop Embedded Coder license when generating code.
Selecting this parameter also selects the required options Support: floating-point numbers, Support: non-finite numbers, and Terminate function required. If you subsequently clear Support: floating-point numbers, Support: non-finite numbers, or Terminate function required, an error is displayed during code generation.
Selecting this parameter clears the incompatible option Suppress error status in real-time model data structure. If you subsequently select Suppress error status in real-time model data structure, an error is displayed during code generation.
Selecting this parameter enables MAT-file variable name modifier.
Clear this option if you are using exported function calls.
MAT-file logging does not work in a referenced model, and no code is generated to implement it.
| Parameter: MatFileLogging |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
| Application | Setting |
|---|---|
| Debugging | On |
| Traceability | No impact |
| Efficiency | Off |
| Safety precaution | Off |
Using Virtualized Output Ports Optimization
Select the string to add to MAT-file variable names.
Default: rt_
| Parameter: LogVarNameModifier |
| Type: string |
| Value: 'none' | 'rt_' | '_rt' |
| Default: 'rt_' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | No impact |
| Safety precaution | No impact |
Specify the data exchange interface (API) to include.
Default: None
Does not include an API in the generated code.
Uses the C API data interface.
Uses an external data interface.
Uses the ASAP2 data interface.
Selecting C API enables the following parameters:
Signals in C API
Parameters in C API
Selecting External mode enables the following parameters:
Transport layer
MEX-file arguments
Static memory allocation
| Parameter: see table |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
| To enable... | Set this parameter... | To this value... |
|---|---|---|
| none | RTWCAPIParams, RTWCAPISignals, ExtMode, GenerateASAP2 | 'off' |
| C API | RTWCAPIParams, RTWCAPISignals | 'on' |
| External mode | ExtMode | 'on' |
| ASAP2 | GenerateASAP2 | 'on' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | No impact |
| Safety precaution | No impact during development None for production code generation |
Interacting with Target Application Signals and Parameters Using the C API
Communicating With Code Executing on a Target System Using Simulink External Mode
Generating Model Information for Host-Based ASAP2 Data Measurement and Calibration
Generate a C API signal structure.
Default: on
This parameter is enabled by selecting Interface > C API.
| Parameter: RTWCAPISignals |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | No impact |
| Safety precaution | No impact |
C API for Interfacing with Signals and Parameters
Generate C API parameter tuning structures.
Default: on
This parameter is enabled by selecting Interface > C API.
| Parameter: RTWCAPIParams |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | No impact |
| Safety precaution | No impact |
C API for Interfacing with Signals and Parameters
Specify the transport protocol for external mode communications.
Default: tcpip
Applies a TCP/IP transport mechanism. The MEX-file name is ext_comm.
Applies a serial transport mechanism. The MEX-file name is ext_serial_win32_comm.
The MEX-file name displayed next to Transport layer cannot be edited in the Configuration Parameters dialog box. The value is specified either in matlabroot/toolbox/simulink/simulink/extmode_transports.m, for targets provided by The MathWorks™, or in an sl_customization.m file, for custom targets and/or custom external mode transports.
This parameter is enabled by selecting External mode in the Interface parameter.
| Parameter: ExtModeTransport |
| Type: integer |
| Value: 0 | 1 |
| Default: 0 |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | No impact |
| Safety precaution | No impact |
Specify arguments to pass to an external mode interface MEX-file for communicating with executing targets.
Default: ""
For TCP/IP interfaces, ext_comm allows three optional arguments:
Network name of your target (for example, 'myPuter' or '148.27.151.12')
Verbosity level (0 for no information or 1 for detailed information)
TCP/IP server port number (an integer value between 256 and 65535, with a default of 17725)
For a serial transport, ext_serial_win32_comm allows three optional arguments:
Verbosity level (0 for no information or 1 for detailed information)
Serial port ID (for example, 1 for COM1, and so on)
Baud rate (selected from the set 1200, 2400, 4800, 9600, 14400, 19200, 38400, 57600, 115200, with a default baud rate of 57600)
Depending on the specified target, this parameter is enabled by Data Exchange > Interface > External mode or by External Mode.
| Parameter: ExtModeMexArgs |
| Type: string |
| Value: any valid arguments |
| Default: "" |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | No impact |
| Safety precaution | No impact |
Control memory buffer for external mode communication.
Default: off
Enables the Static memory buffer size parameter for allocating dynamic memory.
Uses a static memory buffer for external mode instead of allocating dynamic memory (calls to malloc).
To determine how much memory you need to allocate, select verbose mode on the target to display the amount of memory it tries to allocate and the amount of memory available.
Depending on the specified target, this parameter is enabled by Data Exchange > Interface > External mode or by External Mode.
This parameter enables Static memory buffer size.
| Parameter: ExtModeStaticAlloc |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | No impact |
| Safety precaution | No impact |
External Mode Interface Options
Specify the memory buffer size for external mode communication.
Default: 1000000
Enter the number of bytes to preallocate for external mode communications buffers in the target.
If you enter too small a value for your application, external mode issues an out-of-memory error.
To determine how much memory you need to allocate, select verbose mode on the target to display the amount of memory it tries to allocate and the amount of memory available.
This parameter is enabled by Static memory allocation.
| Parameter: ExtModeStaticAllocSize |
| Type: integer |
| Value: any valid value |
| Default: 1000000 |
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | No impact |
| Safety precaution | No impact |
External Mode Interface Options
![]() | Real-Time Workshop Pane: Debug | Real-Time Workshop Pane: RSim Target | ![]() |

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 |