Products & Services Solutions Academia Support User Community Company

Learn more about Real-Time Workshop   

Real-Time Workshop Pane: Custom Code

The Real-Time Workshop Custom Code pane includes the following parameters when the Real-Time Workshop product is installed on your system and you select a GRT- or ERT-based target.

Real-Time Workshop: Custom Code Tab Overview

Create a list of custom C code, directories, source files, and libraries to include in generated files.

Configuration

  1. Select the type of information to include from the list on the left side of the pane.

  2. Enter a string to identify the specific code, directory, source file, or library.

  3. Click Apply.

See Also

Use the same custom code settings as Simulation Target

Specify whether to use the same custom code settings as those in the Simulation Target > Custom Code pane.

Settings

Default: Off

On

Enables using the same custom code settings as those in the Simulation Target > Custom Code pane.

Off

Disables using the same custom code settings as those in the Simulation Target > Custom Code pane.

Command-Line Information

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

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

Use local custom code settings (do not inherit from main model)

Specify if a library model can use custom code settings that are unique from the main model.

Settings

Default: Off

On

Enables a library model to use custom code settings that are unique from the main model.

Off

Disables a library model from using custom code settings that are unique from the main model.

Dependency

This parameter is available only for library models that contain Embedded MATLAB Function blocks, Stateflow charts, or Truth Table blocks. To access this parameter, select Tools > Open RTW Target in the Embedded MATLAB Editor or Stateflow Editor for your library model.

Command-Line Information

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

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

Source file

Specify a source file of code to appear at the top of generated files.

Settings

Default:''

The Real-Time Workshop software places code near the top of the generated model.c or model.cpp file, outside of any function.

Command-Line Information

Parameter: CustomSourceCode
Type: string
Value: any source file name
Default: ''

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

Header file

Specify a header file to include near top of generated file.

Settings

Default:''

The Real-Time Workshop software places header file code near the top of the generated model.h header file.

Command-Line Information

Parameter: CustomHeaderCode
Type: string
Value: any header file name
Default: ''

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

Initialize function

Specify code appearing in an initialize function.

Settings

Default: ''

The Real-Time Workshop software places code inside the model's initialize function in the model.c or model.cpp file.

Command-Line Information

Parameter: CustomInitializer
Type: string
Value: any code
Default: ''

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

Terminate function

Specify code appearing in a terminate function.

Settings

Default: ''

Specify code to appear in the model's generated terminate function in the model.c or model.cpp file.

Dependency

A terminate function is generated only if you select the Terminate function required check box on the Real-Time Workshop pane, Interface tab.

Command-Line Information

Parameter: CustomTerminator
Type: string
Value: any code
Default: ''

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

Include directories

Specify a list of include directories to add to the include path.

Settings

Default:''

Enter a space-separated list of include directories to add to the include path when compiling the generated code.

Command-Line Information

Parameter: CustomInclude
Type: string
Value: any directory file name
Default: ''

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

Source files

Specify a list of source files to compile and link with the generated code.

Settings

Default: ''

Enter a space-separated list of source files to compile and link with the generated code.

Tip

The file name is sufficient if the file is in the current MATLAB directory or in one of the include directories.

Command-Line Information

Parameter: CustomSource
Type: string
Value: any source file name
Default: ''

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

Libraries

Specify a list of additional libraries to link with the generated code.

Settings

Default: ''

Enter a space-separated list of static library files to link with the generated code.

Tip

The file name is sufficient if the file is in the current MATLAB directory or in one of the include directories.

Command-Line Information

Parameter: CustomLibrary
Type: string
Value: any library file name
Default: ''

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

  


Related Products & Applications

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

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