| Simulink® | ![]() |
| On this page… |
|---|
In GUI mode, the debugger Sorted List pane displays lists of blocks for a models root system and each nonvirtual subsystem. Each list lists the blocks that the subsystems contains sorted according to their computational dependencies, alphabetical order, and other block sorting rules. In command-line mode, you can use the slist command to display a model's sorted lists.
---- 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)
These displays include the block index for each command. You can use them to determine the block IDs of the models blocks. Some debugger commands accept block IDs as arguments.
If a block belongs to an algebraic list, the slist command displays an algebraic loop identifier in the entry for the block in the sorted list. The identifier has the form
algId=s#n
where s is the index of the subsystem containing the algebraic loop and n is the index of the algebraic loop in the subsystem. For example, the following entry for an Integrator block indicates that it participates in the first algebraic loop at the root level of the model.
0:1 'test/ss/I1' (Integrator, tid=0) [algId=0#1, discontinuity]
You can use the debugger ashow command to highlight the blocks and lines that make up an algebraic loop. See Displaying Algebraic Loops for more information.
To determine the block in a models diagram that corresponds to a particular index, enter 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 systems window.
The systems command displays a list of the nonvirtual systems in the model that you are debugging. For example, the 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'
Note The systems command does not list subsystems that are purely graphical. That is, subsystems that the model diagram represents as Subsystem blocks but that are solved as part of a parent system. are not listed. In Simulink® models, the root system and triggered or enabled subsystems are true systems. All other subsystems are virtual (that is, graphical) and do not appear in the listing from the systems command. |
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. That is, blocks that indicate relationships between or groupings among computational blocks. |
The zclist command displays a list of blocks in which nonsampled zero crossings can occur during a simulation. For example, zclist displays 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)
The ashow command highlights a specified algebraic loop or the algebraic loop that contains a specified block. To highlight a specified algebraic loop, enter ashow s#n, where s is the index of the system (see Identifying Blocks in Algebraic Loops) 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, enter ashow s:b, where s:b is the block's index. To clear algebraic-loop highlighting from the model diagram, enter ashow clear.
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 debugger 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 Information About the Simulation | Accelerating Models | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |