| Real-Time Workshop® | ![]() |

| On this page… |
|---|
Simulink block / Stateflow object comments Verbose comments for SimulinkGlobal storage class Simulink data object descriptions |
Control the comments that the Real-Time Workshop® software automatically creates and inserts into the generated code.
Specify which comments are in generated files.
Default: on
Places comments in the generated files based on the selections in the Auto generated comments pane.
Omits comments from the generated files.
This parameter enables:
Simulink block / Stateflow object comments
Show eliminated blocks
Verbose comments for SimulinkGlobal storage class
| Parameter: GenerateComments |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'on' |
| Application | Setting |
|---|---|
| Debugging | On |
| Traceability | On |
| Efficiency | No impact |
| Safety precaution | On |
Specify whether to insert Simulink® block and Stateflow® object comments.
Default: on
Inserts automatically generated comments that describe a block's code and objects. The comments precede that code in the generated file.
Suppresses comments.
This parameter is enabled by Include comments.
| Parameter: SimulinkBlockComments |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'on' |
| Application | Setting |
|---|---|
| Debugging | On |
| Traceability | On |
| Efficiency | No impact |
| Safety precaution | On |
Specify whether to insert eliminated block's comments.
Default: off
Inserts statements in the generated code from blocks eliminated as the result of optimizations (such as parameter inlining).
Suppresses statements.
This parameter is enabled by Include comments.
| Parameter: ShowEliminatedStatements |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
| Application | Setting |
|---|---|
| Debugging | On |
| Traceability | On |
| Efficiency | No impact |
| Safety precaution | On |
You can control the generation of comments in the model parameter structure declaration in model_prm.h. Parameter comments indicate parameter variable names and the names of source blocks.
Default: off
Generates parameter comments regardless of the number of parameters.
Generates parameter comments if less than 1000 parameters are declared. This reduces the size of the generated file for models with a large number of parameters.
This parameter is enabled by Include comments.
| Parameter: ForceParamTrailComments |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
| Application | Setting |
|---|---|
| Debugging | On |
| Traceability | On |
| Efficiency | No impact |
| Safety precaution | On |
Specify whether to insert descriptions of blocks into generated code as comments.
Default: off
Includes the following comments in the generated code for each block in the model, with the exception of virtual blocks and blocks removed due to block reduction:
The block name at the start of the code, regardless of whether you select Simulink block / Stateflow object comments
Text specified in the Description field of each Block Parameter dialog box
The block names and descriptions can include international (non-US-ASCII) characters.
Suppresses the generation of block name and description comments in the generated code.
This parameter only appears for ERT-based targets.
| Parameter: InsertBlockDesc |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
| Application | Setting |
|---|---|
| Debugging | On |
| Traceability | On |
| Efficiency | No impact |
| Safety precaution | No impact |
Specify whether to insert descriptions of Simulink data objects into generated code as comments.
Default: off
Inserts contents of the Description field in the Model Explorer Object Properties pane for each Simulink data object (signal, parameter, and bus objects) in the generated code as comments.
The descriptions can include international (non-US-ASCII) characters.
Suppresses the generation of data object property descriptions as comments in the generated code.
This parameter only appears for ERT-based targets.
| Parameter: SimulinkDataObjDesc |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
| Application | Setting |
|---|---|
| Debugging | On |
| Traceability | On |
| Efficiency | No impact |
| Safety precaution | No impact |
Specify whether to include custom comments for module packaging tool (MPT) signal and parameter data objects in generated code.
Default: off
Inserts comments just above the identifiers for signal and parameter MPT objects in generated code.
Suppresses the generation of custom comments for signal and parameter identifiers.
This parameter only appears for ERT-based targets.
This parameter requires that you include the comments in a function defined in an M-file or TLC file that you specify with Custom comments function.
| Parameter: EnableCustomComments |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
| Application | Setting |
|---|---|
| Debugging | On |
| Traceability | On |
| Efficiency | No impact |
| Safety precaution | No impact |
Specify a file that contains comments to be included in generated code for module packing tool (MPT) signal and parameter data objects
Default: ''
Enter the name of the M-file or TLC file for the function that includes the comments to be inserted of your MPT signal and parameter objects. You can specify the file name directly or click Browse and search for a file.
You might use this option to insert comments that document some or all of an object's property values.
This parameter only appears for ERT-based targets.
This parameter is enabled by Custom comments (MPT objects only).
| Parameter: CustomCommentsFcn |
| Type: string |
| Value: any valid file name |
| Default: '' |
| Application | Setting |
|---|---|
| Debugging | Any valid file name |
| Traceability | Any valid file name |
| Efficiency | No impact |
| Safety precaution | No impact |
Specify whether to insert descriptions of Stateflow objects into generated code as comments.
Default: off
Inserts descriptions of Stateflow states, charts, transitions, and graphical functions into generated code as comments. The descriptions come from the Description field in Object Properties pane in the Model Explorer for these Stateflow objects. The comments appear just above the code generated for each object.
The descriptions can include international (non-US-ASCII) characters.
Suppresses the generation of comments for Stateflow objects.
| Parameter: SFDataObjDesc |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
| Application | Setting |
|---|---|
| Debugging | On |
| Traceability | On |
| Efficiency | No impact |
| Safety precaution | No impact |
Specify whether to include requirement descriptions assigned to Simulink blocks in generated code as comments.
Default: off
Inserts the requirement descriptions that you assign to Simulink blocks into the generated code as comments. The Real-Time Workshop software includes the requirement descriptions in the generated code in the following locations.
Model Element | Requirement Description Location |
|---|---|
Model | In the main header file model.h |
Nonvirtual subsystems | At the call site for the subsystem |
Virtual subsystems | At the call site of the closest nonvirtual parent subsystem. If a virtual subsystem has no nonvirtual parent, requirement descriptions are located in the main header file for the model, model.h. |
Nonsubsystem blocks | In the generated code for the block |
The requirement text can include international (non-US-ASCII) characters.
Suppresses the generation of comments for block requirement descriptions.
This parameter only appears for ERT-based targets.
| Parameter: ReqsInCode |
| Type: string |
| Value: 'on' | 'off' |
| Default: 'off' |
| Application | Setting |
|---|---|
| Debugging | On |
| Traceability | On |
| Efficiency | No impact |
| Safety precaution | On |
Including Requirements with Generated Code in the Simulink® Verification and Validation™ documentation
![]() | Real-Time Workshop Pane: Report | Real-Time Workshop Pane: Symbols | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |