ID: Title | hisl_0032: Model object names |
---|---|
Description | For the following model object names:
Use:
Do not:
|
Notes | Reserved names:
|
Rationale |
|
Model Advisor Checks |
For check details, see Check model object names (Simulink Check). |
See Also | MAB guidelines:
|
References |
|
Last Changed | R2018b |
Example | Recommended
Not Recommended
|
ID: Title | hisl_0061: Unique identifiers for clarity | ||
---|---|---|---|
Description | When developing a model: | ||
A | Use unique identifiers for Simulink signals. | ||
B | Define unique identifiers across multiple scopes within a chart. | ||
Notes | The code generator resolves conflicts between identifiers so that symbols in the generated code are unique. The process is called name mangling. | ||
Rationale | A, B | Improve readability of a graphical model and mapping between identifiers in the model and generated code. | |
Model Advisor Check |
For check details, see Check Stateflow charts for uniquely defined data objects (Simulink Check). | ||
References |
| ||
See Also | Code Appearance (Simulink Coder) | ||
Last Changed | R2017b | ||
Examples | Not Recommended In the following example, two states The
identifier | ||
Recommended To
clarify the model, create unique identifiers. In the following example,
state The
identifier |
ID: Title | hisl_0062: Global variables in graphical functions |
---|---|
Description | For data with a global scope used in a function, do not use the data in the calling expression if a value is assigned to the data in that function. |
Rationale | Enhance readability of a model by removing ambiguity in the values of global variables. |
Model Advisor Checks |
For check details, see Check global variables in graphical functions (Simulink Check). |
References |
|
Last Changed | R2018b |
Examples | Consider a graphical function Recommended Not Recommended |
ID: Title | hisl_0063: Length of user-defined object names to improve MISRA C:2012 compliance | |
---|---|---|
Description | To improve MISRA C:2012 compliance of generated code,
use configuration parameter Maximum identifier
length ( NoteThe default of Maximum identifier length is
| |
A | For Subsystem blocks with parameter Function name options set to
User specified , limit the length of function
names to be equal to or less than the value specified in Maximum
identifier length. | |
B | Limit the length of data object names to be equal to or less than the value specified in Maximum identifier length:
| |
C | When using these storage classes, limit the length of signal and parameter names to be equal to or less than the value specified in Maximum identifier length:
NoteIf specified, this includes the length of the Identifier name. | |
Rationale | Length in the generated code can result in a MISRAC:2012 violation. | |
Model Advisor Checks |
For check details, see Check for length of user-defined object names (Simulink Check). | |
References |
| |
Prerequisites | hisl_0060: Configuration parameters that improve MISRA C:2012 compliance | |
Last Changed | R2018b |