Main Content

slist

Display sorted list of blocks in model during simulation debugging session

Syntax

Description

slist displays in the MATLAB® Command Window the sorted list of blocks in the root system and each nonvirtual subsystem or referenced model in the root system. For the root system, each nonvirtual subsystem, and each referenced model, the returned information includes:

  • A title line that indicates the name of the system, the number of nonvirtual blocks in the system, and the number of blocks in the system that have ports with direct feedthrough

  • An entry for each block in the system in the order in which the blocks appear in the sorted list

Each block entry includes:

  • The block ID in the form of (t)s:b, where t is the task index, s is the system index, and b is the block index.

  • The number and indices of input ports on the block.

  • The number and indices of output ports on the block.

The slist function displays only nonvirtual blocks in the model. Virtual blocks do not appear in the sorted list.

When a block is part of an algebraic loop, the sorted list information also includes the algebraic loop identifier for the block. The algebraic loop identifier has the form algID=s#n, where s is the index of the subsystem that contains the algebraic loop and n is the index of the algebraic loop within the system. During a simulation debugging session, you can use the ashow function to highlight the blocks in an algebraic loop.

The software uses the sorted list to create block method execution lists for the root system, each nonvirtual subsystem, and each referenced model. Typically, the block methods are invoked in the same order that they appear in the sorted list. In some cases, the execution order does differ from the order in the sorted list. For example, in models that group blocks that execute at the same rate into separate tasks, the block execution order can differ from the order of blocks in the sorted list.

You can use this function in a simulation debugging session started:

  • Interactively, using the Simulink® Toolstrip

  • Programmatically, using the sldebug function

  • Programmatically, using the sim function with the 'debug' name-value argument

Note

This function is available only for simulation debugging sessions started programmatically and for interactive simulation debugging sessions while paused within a time step.

example

Examples

collapse all

Use the slist function to display the sorted list for the model vdp in a simulation debugging session.

Open the model vdp.

openExample("simulink_general/VanDerPolOscillatorExample",...
    supportingFile="vdp")

Start a simulation debugging session for the model vdp using the sldebug function. The MATLAB command prompt (>>) becomes the Simulink debugger prompt ((sldebug @0): >> ).

sldebug vdp
(sldebug @0): >> 

Use the slist function to view the sorted list for the model.

slist
---- Sorted list for 'vdp' [13 nonvirtual block(s), directFeed=0]
     Total number of tasks = 2
- Sorted list of task index [0], 12 nonvirtual block(s)
  (0)0:1   'vdp/x1' (Integrator)
          Input ports:  [0]
          Output ports: [0]
  (0)0:2   'vdp/Out1' (Outport)
          Input ports:  [0]
          Output ports: []
  (0)0:3   'vdp/x2' (Integrator)
          Input ports:  [0]
          Output ports: [0]
  (0)0:4   'vdp/Out2' (Outport)
          Input ports:  [0]
          Output ports: []
  (0)0:5   'vdp/Scope' (Scope)
          Input ports:  [0 1]
          Output ports: []
  (0)0:6   'vdp/TAQOutportLogging_InsertedFor_x1_at_outport_0' (ToAsyncQueueBlock)
          Input ports:  [0]
          Output ports: []
  (0)0:7   'vdp/TAQOutportLogging_InsertedFor_x2_at_outport_0' (ToAsyncQueueBlock)
          Input ports:  [0]
          Output ports: []
  (0)0:8   'vdp/Square' (Math)
          Input ports:  [0]
          Output ports: [0]
  (0)0:9   'vdp/Sum1' (Sum)
          Input ports:  [0 1]
          Output ports: [0]
  (0)0:10  'vdp/Product' (Product)
          Input ports:  [0 1]
          Output ports: [0]
  (0)0:11  'vdp/Mu/Slider Gain' (Gain)
          Input ports:  [0]
          Output ports: [0]
  (0)0:12  'vdp/Sum' (Sum)
          Input ports:  [0 1]
          Output ports: [0]

- Sorted list of task index [1], 1 nonvirtual block(s)
  (1)0:1   'vdp/Constant' (Constant)
          Input ports:  []
          Output ports: [0]

 ----- Task Index Legend -----
 Task Index [0]: Cont	FiM	
 Task Index [1]: Constant	
 -----------------------------

When you have finished debugging, use the stop function to end the simulation debugging session.

stop

Tips

To start a simulation debugging session interactively, add one or more breakpoints to your model, and in the Breakpoints List, check that Pause within time step is selected. When the simulation pauses on a breakpoint, some of the programmatic debugging commands, such as the stop command, are available for use in the MATLAB Command Window.

Version History

Introduced before R2006a

expand all