Real-Time Workshop Pane: Comments

Comments Tab Overview

Control the comments that the Real-Time Workshop® software automatically creates and inserts into the generated code.

Include comments

Specify which comments are in generated files.

Settings

Default: on

On

Places comments in the generated files based on the selections in the Auto generated comments pane.

Off

Omits comments from the generated files.

Dependencies

This parameter enables:

Command-Line Information

Parameter: GenerateComments
Type: string
Value: 'on' | 'off'
Default: 'on'

Recommended Settings

ApplicationSetting
DebuggingOn
TraceabilityOn
EfficiencyNo impact
Safety precautionOn

Simulink block / Stateflow object comments

Specify whether to insert Simulink® block and Stateflow® object comments.

Settings

Default: on

On

Inserts automatically generated comments that describe a block's code and objects. The comments precede that code in the generated file.

Off

Suppresses comments.

Dependency

This parameter is enabled by Include comments.

Command-Line Information

Parameter: SimulinkBlockComments
Type: string
Value: 'on' | 'off'
Default: 'on'

Recommended Settings

ApplicationSetting
DebuggingOn
TraceabilityOn
EfficiencyNo impact
Safety precautionOn

Show eliminated blocks

Specify whether to insert eliminated block's comments.

Settings

Default: off

On

Inserts statements in the generated code from blocks eliminated as the result of optimizations (such as parameter inlining).

Off

Suppresses statements.

Dependency

This parameter is enabled by Include comments.

Command-Line Information

Parameter: ShowEliminatedStatements
Type: string
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

ApplicationSetting
DebuggingOn
TraceabilityOn
EfficiencyNo impact
Safety precautionOn

Verbose comments for SimulinkGlobal storage class

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.

Settings

Default: off

On

Generates parameter comments regardless of the number of parameters.

Off

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.

Dependency

This parameter is enabled by Include comments.

Command-Line Information

Parameter: ForceParamTrailComments
Type: string
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

ApplicationSetting
DebuggingOn
TraceabilityOn
EfficiencyNo impact
Safety precautionOn

Simulink block descriptions

Specify whether to insert descriptions of blocks into generated code as comments.

Settings

Default: off

On

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.

Off

Suppresses the generation of block name and description comments in the generated code.

Dependency

This parameter only appears for ERT-based targets.

Command-Line Information

Parameter: InsertBlockDesc
Type: string
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

ApplicationSetting
DebuggingOn
TraceabilityOn
EfficiencyNo impact
Safety precautionNo impact

See Also

Support for International (Non-US-ASCII) Characters

Simulink data object descriptions

Specify whether to insert descriptions of Simulink data objects into generated code as comments.

Settings

Default: off

On

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.

Off

Suppresses the generation of data object property descriptions as comments in the generated code.

Dependency

This parameter only appears for ERT-based targets.

Command-Line Information

Parameter: SimulinkDataObjDesc
Type: string
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

ApplicationSetting
DebuggingOn
TraceabilityOn
EfficiencyNo impact
Safety precautionNo impact

Custom comments (MPT objects only)

Specify whether to include custom comments for module packaging tool (MPT) signal and parameter data objects in generated code.

Settings

Default: off

On

Inserts comments just above the identifiers for signal and parameter MPT objects in generated code.

Off

Suppresses the generation of custom comments for signal and parameter identifiers.

Dependency

Command-Line Information

Parameter: EnableCustomComments
Type: string
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

ApplicationSetting
DebuggingOn
TraceabilityOn
EfficiencyNo impact
Safety precautionNo impact

See Also

Adding Custom Comments

Custom comments function

Specify a file that contains comments to be included in generated code for module packing tool (MPT) signal and parameter data objects

Settings

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.

Tip

You might use this option to insert comments that document some or all of an object's property values.

Dependency

Command-Line Information

Parameter: CustomCommentsFcn
Type: string
Value: any valid file name
Default: ''

Recommended Settings

ApplicationSetting
DebuggingAny valid file name
TraceabilityAny valid file name
EfficiencyNo impact
Safety precautionNo impact

See Also

Adding Custom Comments

Stateflow object descriptions

Specify whether to insert descriptions of Stateflow objects into generated code as comments.

Settings

Default: off

On

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.

Off

Suppresses the generation of comments for Stateflow objects.

Command-Line Information

Parameter: SFDataObjDesc
Type: string
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

ApplicationSetting
DebuggingOn
TraceabilityOn
EfficiencyNo impact
Safety precautionNo impact

See Also

Support for International (Non-US-ASCII) Characters

Requirements in block comments

Specify whether to include requirement descriptions assigned to Simulink blocks in generated code as comments.

Settings

Default: off

On

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.

Off

Suppresses the generation of comments for block requirement descriptions.

Dependency

This parameter only appears for ERT-based targets.

Command-Line Information

Parameter: ReqsInCode
Type: string
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

ApplicationSetting
DebuggingOn
TraceabilityOn
EfficiencyNo impact
Safety precautionOn

See Also

Including Requirements with Generated Code in the Simulink® Verification and Validation™ documentation

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS