Guy on Simulink

Simulink & Model-Based Design

Accelerating the Simulink Debugger

This week I want to share a useful trick to save debugging time:Using the Simulink Debugger in Accelerator Mode.

Simulink Debugger in Accelerator Mode

Did you know that the Simulink Debugger can run in Accelerator Mode? If you need to investigate a problem that happens late in a simulation, this can be very useful. This can help you reach the problem significantly faster than executing in normal mode.

Start by setting your model to Accelerator Mode:

configure the model for accelerator mode

The functionality needed to toggle between accelerator and normal mode is accessible through the Simulink Debugger command line interface.

At the MATLAB command prompt, try the following:

  • Start the debugger usingsldebug
  • Set a time breakpoint usingtbreak
  • Simulate until the breakpoint is reached usingcontinue
  • To see which block methods are available, we can increase the execution tracing usingetrace 3
  • While still in accelerator mode,stepand observe that only model level methods are available
  • Useemodeto switch to Normal mode
  • After switching to Normal Mode, we canstepblock by block and observe data for each block

Switching between Accelerator and Normal debugging modes

Now it's your turn

Try accelerating your debugging and let us know how it goes by leaving acomment here.

|
  • print
  • send email

Comments

To leave a comment, please clickhereto sign in to your MathWorks Account or create a new one.