| Using Simulink | ![]() |
Displaying a Block
To determine which block in a model's diagram corresponds to a particular index, type bshow s:b at the command prompt, where s:b is the block index. The bshow command opens the system containing the block (if necessary) and selects the block in the system's window.
Displaying a Model's Nonvirtual Systems
The systems command prints a list of the nonvirtual systems in the model being debugged. For example, the Simulink clutch demo (clutch) contains the following systems.
sldebug clutch [Tm=0 ] **Start** of system 'clutch' outputs (sldebug @0:0 'clutch/Clutch Pedal'): systems 0 'clutch' 1 'clutch/Locked' 2 'clutch/Unlocked'
Displaying a Model's Nonvirtual Blocks
The slist command displays a list of the nonvirtual blocks in a model. The listing groups the blocks by system. For example, the following sequence of commands produces a list of the nonvirtual blocks in the Van der Pol (vdp) demo model.
sldebug vdp [Tm=0 ] **Start** of system 'vdp' outputs (sldebug @0:0 'vdp/Integrator1'): slist ---- Sorted list for 'vdp' [12 blocks, 9 nonvirtual blocks, directFeed=0] 0:0 'vdp/Integrator1' (Integrator) 0:1 'vdp/Out1' (Outport) 0:2 'vdp/Integrator2' (Integrator) 0:3 'vdp/Out2' (Outport) 0:4 'vdp/Fcn' (Fcn) 0:5 'vdp/Product' (Product) 0:6 'vdp/Mu' (Gain) 0:7 'vdp/Scope' (Scope) 0:8 'vdp/Sum' (Sum)
Note
The slist command does not list blocks that are purely graphical in nature, that is, blocks that indicate relationships or groupings among computational blocks. |
Displaying Blocks with Potential Zero-Crossings
The zclist prints a list of blocks in which nonsampled zero-crossings can occur during a simulation. For example, zclist prints the following list for the clutch sample model.
(sldebug @0:0 'clutch/Clutch Pedal'): zclist
2:3 'clutch/Unlocked/Sign' (Signum)
0:4 'clutch/Lockup Detection/Velocities Match' (HitCross)
0:10 'clutch/Lockup Detection/Required Friction
for Lockup/Abs' (Abs)
0:11 'clutch/Lockup Detection/Required Friction for
Lockup/ Relational Operator' (RelationalOperator)
0:18 'clutch/Break Apart Detection/Abs' (Abs)
0:20 'clutch/Break Apart Detection/Relational Operator'
(RelationalOperator)
0:24 'clutch/Unlocked' (SubSystem)
0:27 'clutch/Locked' (SubSystem)
Displaying Algebraic Loops
The ashow command highlights a specified algebraic loop or the algebraic loop that contains a specified block. To highlight a specified algebraic loop, type ashow s#n, where s is the index of the system (see Displaying a Model's Block Execution Order) that contains the loop and n is the index of the loop in the system. To display the loop that contains the currently selected block, enter ashow gcb. To show a loop that contains a specified block, type ashow s:b, where s:b is the block's index. To clear algebraic-loop highlighting from the model diagram, enter ashow clear.
Displaying Debugger Status
In GUI mode, the debugger displays the settings of various debug options, such as conditional breakpoints, in its Status panel. In command-line mode, the status command displays debuggers settings. For example, the following sequence of commands displays the initial debug settings for the vdp model.
sim('vdp',[0,10],simset('debug','on'))
[Tm=0 ] **Start** of system 'vdp' outputs
(sldebug @0:0 'vdp/Integrator1'): status
Current simulation time: 0 (MajorTimeStep)
Last command: ""
Stop in minor times steps is disabled.
Break at zero crossing events is disabled.
Break when step size is limiting by a state is disabled.
Break on non-finite (NaN,Inf) values is disabled.
Display of integration information is disabled.
Algebraic loop tracing level is at 0.
| Displaying a Model's Block Execution Order | Debugger Command Reference | ![]() |