Real-Time Workshop    

General Code Appearance Options

The General code appearance options control formatting of source code and construction of identifiers. This interface is shown below.

Maximium Identifier Length Option

The Maximium identifier length field allows you to limit the number of characters in function, typedef, and variable names. The default is 31 characters, but Real-Time Workshop imposes no upper limit.You may choose to increase this length for models with deep hierarchical structure, as well as when exercising some of the mnemonic identifier options described below.

Include Data Type Acronym in Identifier Option

Selecting Include data type acronym in identifier enables you to prepend acronyms such as i32 (for long integers) to signal and work vector identifiers to make code more readable. The default is not to include datatype acronyms in identifiers. For example, with this option selected, Real-Time Workshop identifies a scalar double signal from a discrete pulse generator as follows:

Include System Hierarchy Number in Identifiers Option

When this option is selected, Real-Time Workshop inserts identification tags in the generated code (in addition to tags included in comments). The tags are designed to help you identify the nesting level, within your source model, of the block that generated a given line of code.

When this option is ON, the tag format is either

By default, Include system hierarchy number in identifiers is OFF, in order to generate more compact code.

As an example, consider hier.mdl, the model in this picture.

The subsystem within hier.mdl is shown in the picture below.

With Include system hierarchy number in identifiers on, the following code is generated for the Out1 block of hier.mdl. The code includes the tag s1_ in the symbols generated for the subsystem, and the tag root_ in the symbol generated for the root-level Out1 block.

This code, generated with Include system hierarchy number in identifiers off, does not contain a subsystem tag in the generated symbols.

See Tracing Generated Code Back to Your Simulink Model for further information on using system and block identification tags.

Prefix Model Name to Global Identifiers Option

When this option is selected, subsystem function names are prefixed with the name of the model (model_) for all code formats. In addition, when appropriate to the code format, the model name is also prefixed to the names of functions and data structures at the model level. This is useful when you need to compile and link code from two or more models into a single executable, as it avoids potential name clashes. Prefix model name to global identifiers is ON by default.

Generate Scalar Inlined Parameters as Option

When the Inline Parameters Option is selected and signals are scalars having constant sample time, this pull-down menu enables you to control how parameters are expressed in the code. There are two choices for this option:

The default is Literals. This provides backward compatibility to prior versions of Real-Time Workshop, which lacked this option. It also may help in debugging TLC code, as it makes the values of parameters easy to search for. The Macros option, on the other hand, may make code more readable.

Generate Comments Option

By default, Generate comments is ON. If this option is OFF, generation of comments in the code is completely suppressed. The Show eliminated statements and Force generation of parameter comments options in the General code generation category enable the inclusion of those specific types of comments.


  General Code Generation Options Target-specific Code Generation Options