Skip to Main Content Skip to Search
Product Documentation

Code Generation Pane: Data Type Replacement

Code Generation: Data Type Replacement Tab Overview

Replace built-in data type names with user-defined replacement data type names in the generated code for your model.

Configuration

This tab appears only if you specify an ERT based System target file.

If your application requires you to replace built-in data type names with user-defined replacement data type names in the generated code:

  1. Select Replace data type names in the generated code.

  2. Selectively specify replacement data type names to use for built-in Simulink data types in the Replacement Name fields.

See Also

Replace data type names in the generated code

Specify whether to replace built-in data type names with user-defined data type names in generated code.

Settings

Default: off

On

Displays the Data type names table. The table provides a way for you to replace the names of built-in data types used in generated code. This mechanism can be particularly useful for generating code that adheres to application or site data type naming standards.

You can choose to specify new data type names for some or all Simulink built-in data types listed in the table. For each replacement data type name that you specify:

  • The name must match the name of a Simulink.AliasType object that exists in the base workspace.

  • The BaseType property of the associated Simulink.AliasType object must be consistent with the built-in data type it replaces.

  • For double, single, int32, int16, int8, uint32, uint16, and uint8, the BaseType of the replacement data type must match the built-in data type.

  • For boolean, the BaseType of the replacement data type must be either an 8-bit integer or an integer of the size displayed for Number of bits: int on the Hardware Implementation pane of the Configuration Parameters dialog box.

  • For int, uint, and char, the size of the replacement data type must match the size displayed for Number of bits: int or Number of bits: char on the Hardware Implementation pane of the Configuration Parameters dialog box.

An error occurs if a replacement data type specification is inconsistent.

Off

Uses Simulink Coder names for built-in Simulink data types in generated code.

Dependencies

This parameter enables:

double Replacement Name
single Replacement Name
int32 Replacement Name
int16 Replacement Name
int8 Replacement Name
uint32 Replacement Name
uint16 Replacement Name
uint8 Replacement Name
boolean Replacement Name
int Replacement Name
uint Replacement Name
char Replacement Name

Command-Line Information

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

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityOn
EfficiencyNo impact
Safety precautionNo impact

See Also

Data Type Replacement

Replacement Name: double

Specify names to use for built-in Simulink data types in generated code.

Settings

Default: ''

Specify strings that the code generator is to use as names for built-in Simulink data types.

An error occurs if a replacement data type specification is inconsistent.

Dependency

This parameter is enabled by Replace data type names in the generated code.

Command-Line Information

Parameter: ReplacementTypes, replacementName.double
Type: string
Value: name of a Simulink.AliasType object that exists in the base workspace; BaseType property of object must be consistent with the built-in data type it replaces and BaseType of the replacement data type must match the built-in data type
Default: ''

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityAny valid string
EfficiencyNo impact
Safety precaution''

See Also

Data Type Replacement

Replacement Name: single

Specify names to use for built-in Simulink data types in generated code.

Settings

Default: ''

Specify strings that the code generator is to use as names for built-in Simulink data types.

An error occurs if a replacement data type specification is inconsistent.

Dependency

This parameter is enabled by Replace data type names in the generated code.

Command-Line Information

Parameter: ReplacementTypes, replacementName.single
Type: string
Value: name of a Simulink.AliasType object that exists in the base workspace; BaseType property of object must be consistent with the built-in data type it replaces and BaseType of the replacement data type must match the built-in data type
Default: ''

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityAny valid string
EfficiencyNo impact
Safety precaution''

See Also

Data Type Replacement

Replacement Name: int32

Specify names to use for built-in Simulink data types in generated code.

Settings

Default: ''

Specify strings that the code generator is to use as names for built-in Simulink data types.

An error occurs if a replacement data type specification is inconsistent.

Dependency

This parameter is enabled by Replace data type names in the generated code.

Command-Line Information

Parameter: ReplacementTypes, replacementName.int32
Type: string
Value: name of a Simulink.AliasType object that exists in the base workspace; BaseType property of object must be consistent with the built-in data type it replaces and BaseType of the replacement data type must match the built-in data type
Default: ''

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityAny valid string
EfficiencyNo impact
Safety precaution''

See Also

Data Type Replacement

Replacement Name: int16

Specify names to use for built-in Simulink data types in generated code.

Settings

Default: ''

Specify strings that the code generator is to use as names for built-in Simulink data types .

An error occurs if a replacement data type specification is inconsistent.

Dependency

This parameter is enabled by Replace data type names in the generated code.

Command-Line Information

Parameter: ReplacementTypes, replacementName.int16
Type: string
Value: name of a Simulink.AliasType object that exists in the base workspace; BaseType property of object must be consistent with the built-in data type it replaces and BaseType of the replacement data type must match the built-in data type
Default: ''

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityAny valid string
EfficiencyNo impact
Safety precaution''

See Also

Data Type Replacement

Replacement Name: int8

Specify names to use for built-in Simulink data types in generated code.

Settings

Default: ''

Specify strings that the code generator is to use as names for built-in Simulink data types.

An error occurs if a replacement data type specification is inconsistent.

Dependency

This parameter is enabled by Replace data type names in the generated code.

Command-Line Information

Parameter: ReplacementTypes, replacementName.int8
Type: string
Value: name of a Simulink.AliasType object that exists in the base workspace; BaseType property of object must be consistent with the built-in data type it replaces and BaseType of the replacement data type must match the built-in data type
Default: ''

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityAny valid string
EfficiencyNo impact
Safety precaution''

See Also

Data Type Replacement

Replacement Name: uint32

Specify names to use for built-in Simulink data types in generated code.

Settings

Default: ''

Specify strings that the code generator is to use as names for built-in Simulink data types.

An error occurs if a replacement data type specification is inconsistent.

Dependency

This parameter is enabled by Replace data type names in the generated code.

Command-Line Information

Parameter: ReplacementTypes, replacementName.uint32
Type: string
Value: name of a Simulink.AliasType object that exists in the base workspace; BaseType property of object must be consistent with the built-in data type it replaces and BaseType of the replacement data type must match the built-in data type
Default: ''

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityAny valid string
EfficiencyNo impact
Safety precaution''

See Also

Data Type Replacement

Replacement Name: uint16

Specify names to use for built-in Simulink data types in generated code.

Settings

Default: ''

Specify strings that the code generator is to use as names for built-in Simulink data types.

An error occurs if a replacement data type specification is inconsistent.

Dependency

This parameter is enabled by Replace data type names in the generated code.

Command-Line Information

Parameter: ReplacementTypes, replacementName.uint16
Type: string
Value: name of a Simulink.AliasType object that exists in the base workspace; BaseType property of object must be consistent with the built-in data type it replaces and BaseType of the replacement data type must match the built-in data type
Default: ''

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityAny valid string
EfficiencyNo impact
Safety precaution''

See Also

Data Type Replacement

Replacement Name: uint8

Specify names to use for built-in Simulink data types in generated code.

Settings

Default: ''

Specify strings that the code generator is to use as names for built-in Simulink data types.

An error occurs if a replacement data type specification is inconsistent.

Dependency

This parameter is enabled by Replace data type names in the generated code.

Command-Line Information

Parameter: ReplacementTypes, replacementName.uint8
Type: string
Value: name of a Simulink.AliasType object that exists in the base workspace; BaseType property of object must be consistent with the built-in data type it replaces and BaseType of the replacement data type must match the built-in data type
Default: ''

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityAny valid string
EfficiencyNo impact
Safety precaution''

See Also

Data Type Replacement

Replacement Name: boolean

Specify names to use for built-in Simulink data types in generated code.

Settings

Default: ''

Specify strings that the code generator is to use as names for built-in Simulink data types.

An error occurs if a replacement data type specification is inconsistent.

Dependency

This parameter is enabled by Replace data type names in the generated code.

Command-Line Information

Parameter: ReplacementTypes, replacementName.boolean
Type: string
Value: name of a Simulink.AliasType object that exists in the base workspace; BaseType property of object must be either an 8-bit integer or an integer of the size displayed for Number of bits: int on the Hardware Implementation pane of the Configuration Parameters dialog box
Default: ''

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityAny valid string
EfficiencyNo impact
Safety precaution''

See Also

Replacement Name: int

Specify names to use for built-in Simulink data types in generated code.

Settings

Default: ''

Specify strings that the code generator is to use as names for built-in Simulink data types.

An error occurs if a replacement data type specification is inconsistent.

Dependency

This parameter is enabled by Replace data type names in the generated code.

Command-Line Information

Parameter: ReplacementTypes, replacementName.int
Type: string
Value: name of a Simulink.AliasType object that exists in the base workspace; BaseType property of object must be consistent with the built-in data type it replaces and the size of the replacement data type must match the size displayed on the Hardware Implementation pane of the Configuration Parameters dialog box
Default: ''

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityAny valid value
EfficiencyNo impact
Safety precaution''

See Also

Data Type Replacement

Replacement Name: uint

Specify names to use for built-in Simulink data types in generated code.

Settings

Default: ''

Specify strings that the code generator is to use as names for built-in Simulink data types.

An error occurs if a replacement data type specification is inconsistent.

Dependency

This parameter is enabled by Replace data type names in the generated code.

Command-Line Information

Parameter: ReplacementTypes, replacementName.uint
Type: string
Value: name of a Simulink.AliasType object that exists in the base workspace; BaseType property of object must be consistent with the built-in data type it replaces and the size of the replacement data type must match the size displayed on the Hardware Implementation pane of the Configuration Parameters dialog box
Default: ''

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityAny valid string
EfficiencyNo impact
Safety precaution''

See Also

Data Type Replacement

Replacement Name: char

Specify names to use for built-in Simulink data types in generated code.

Settings

Default: ''

Specify strings that the code generator is to use as names for built-in Simulink data types.

An error occurs if a replacement data type specification is inconsistent.

Dependency

This parameter is enabled by Replace data type names in the generated code.

Command-Line Information

Parameter: ReplacementTypes, replacementName.char
Type: string
Value: name of a Simulink.AliasType object that exists in the base workspace; BaseType property of object must be consistent with the built-in data type it replaces and the size of the replacement data type must match the size displayed on the Hardware Implementation pane of the Configuration Parameters dialog box
Default: ''

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityAny valid string
EfficiencyNo impact
Safety precaution''

See Also

Data Type Replacement

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

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