Main Content

Detect non-reused custom storage classes

Diagnostic behavior when code generation cannot reuse Reusable storage class

Model Configuration Pane: Diagnostics / Data Validity

Description

This parameter specifies the diagnostic behavior when a model contains a Reusable storage class that the code generator cannot reuse with other instances of the same Reusable storage class.

The code generator might not implement the reuse specification for a Reusable storage class if:

  • The code generator cannot change the block execution order to enable reuse.

  • The conditional execution of some blocks in the model is incompatible with reuse.

When the code generator does not implement the reuse specification, the generated code likely contains additional global variables. For example, in this model, the code generator cannot reuse the variable Y to hold the outputs of In2, Gain, and Gain2 because Gain executes before Gain2. The generated code contains an extra variable to hold the Gain output. The red numbers to the top right of the blocks indicate the execution order.

Dependencies

To enable this parameter, set System target file to ert.tlc.

Settings

warning (default) | error | none

The diagnostic behavior for each setting varies based on whether the model contains Reusable storage classes and model references.

none

If the model does not contain Reusable storage classes and referenced models, the software does not issue a message when the code generator cannot reuse a Reusable storage class.

If the model contains Reusable storage classes and referenced models, the software issues a message that suggests changing this parameter value to error.

warning

If the model does not contain Reusable storage classes and referenced models, the software issues a warning when the code generator cannot reuse a Reusable storage class.

If the model contains reusable storage classes and referenced models, the software issues a message that advises changing this parameter value to error.

error

The software issues an error if the code generator cannot reuse a Reusable storage class.

Use this setting if you want to prevent additional global variables in the generated code because of a Reusable storage class specification that the code generator cannot honor. Remove the Reusable storage class specification from the signal line in the error message.

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

Programmatic Use

Parameter: RCSCRenamedMsg
Type: string | character vector
Values: 'none' | 'warning' | 'error'
Default: 'warning'

Version History

Introduced in R2017b