Target Language Compiler |
 |
Start the Debugger and Explore Commands
We use the TLC debugger to monitor the code generation process. As it is not invoked by default, we need to request the debugger to start.
- Set up the TLC debugging environment and start to build the application:
- Click the Real-Time Workshop tab, and change the pull-down menu labeled Category from
Target configuration
to TLC debugging
.
Select the check boxes Retain .rtw file and Start TLC debugger when generating code.
Click the Build button.
The MATLAB command window describes the building process. The build stops at the gain.tlc
file and displays the command prompt:
- Type
help
to list the TLC debugger commands. Here are some things you can do in the debugger; try them if you like:
- View and query various entities in the TLC scope. For example:
-
TLC-DEBUG> whos CompiledModel
TLC-DEBUG> print CompiledModel.NumSystems
TLC-DEBUG> print TYPE(CompiledModel.NumSystems)
- Examine the statements in your current context. For example:
-
TLC-DEBUG> list
TLC-DEBUG> list 10,40
- move to the next line of code:
- Assign a constant value to a variable, such as the input signal
%<u>
:
- Set a breakpoint where you are or in some other part of the code:
- Execute until the next breakpoint:
- Clear breakpoints you have established:
-
TLC-DEBUG> clear 1
TLC-DEBUG> clear all
| Generate and Run Code from the Model | | Debug gain.tlc |  |