Real-Time Workshop | ![]() ![]() |
Target Language Compiler Variables and Options
The Target Language Compiler supports extended code generation variables and options in addition to those included in the code generation options categories of the Real-Time Workshop pane.
There are two ways to set TLC variables and options:
Assigning Target Language Compiler Variables
The %assign statement lets you assign a value to a TLC variable, as in
This is also known as creating a parameter name/parameter value pair.
The %assign statement is described in the Target Language Compiler Reference Guide. It is recommended that you write your %assign
statements in the Configure RTW code generation settings
section of the system target file.
The following table lists the code generation variables you can set with the %assign statement.
Variable |
Description |
MaxStackSize= N |
|
MaxStackVariableSize= N |
When Local block outputs is enabled, this limits the size of any local variable declared in a function to N bytes, where N>0 . A variable whose size exceeds MaxStackVariableSize will be allocated in global, rather than local, memory |
WarnNonSaturatedBlocks= value |
Flag to control display of overflow warnings for blocks that have saturation capability, but have it turned off (unchecked) in their dialog. These are the options: |
BlockIOSignals=value |
Supports monitoring signals in a running model. See Signal Monitoring via Block Outputs. Setting the variable causes the model _bio.c file to be generated. These are the options: |
ParameterTuning=value |
Setting the variable to 1 causes a parameter tuning file (model _pt.c) to be generated. model _pt.c contains data structures that enable a running program to access model parameters independent of external mode. See C API for Parameter Tuning. |
Setting Target Language Compiler Options
You can enter TLC options directly into the System target file field in the Target configuration
category of the Real-Time Workshop tab of the Simulation Parameters dialog, by appending the options and arguments to the system target filename. This is equivalent to invoking the Target Language Compiler with options on the MATLAB command line.
The common options are shown in the table below.
![]() | Configuring the Generated Code via TLC | Generated Code Formats | ![]() |