Stepping through sorted order of Simulink model

I have a Simulink model that may be executing blocks in a different order than I expect. So, I would like to check the order that the blocks are executed. The information returned by Format > Block Displays > Sort Order is not intuitive. I would prefer to "step" through the model and highlight each block as it is being executed, pulling up whatever subsystem that the block resides in. I don't need to go through the entire simulation; just a couple of loops through should be enough.
Is it possible to step through blocks in their order of execution?

 Réponse acceptée

Kaustubha Govind
Kaustubha Govind le 16 Mar 2012

3 votes

Yes, you can do that with the Simulink Debugger.

2 commentaires

K E
K E le 19 Mar 2012
Thanks, very helpful. I learned that it is possible to list the sort order of blocks as follows,
sldebug 'myModelNameNoExtension'
slist
And then you can highlight the relevant block using
hilite_system('nameOfBlockFromSlist', 'find')
if you manually cut & paste in one of the block names that slist outputs.
K E
K E le 19 Mar 2012
How to step through the blocks with the debugger, in case it is useful to another beginner,
* Open model and load any workspace variables
* Tools > Simulink Debugger
* 'Play' button to start simulation (will stop at first block)
* 'Go to the next block method' button (2 squares) to step forward one block
* Or, choose 'Animate' button then 'Play' button to see blocks executed in order. Unfortunately, will not open up the subsystems as they are executed.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by