Why Execution Order of Sum block is not shown in the Simulink model?

Following is a snapshot of my simulink model.
The Information Overlays in the Simulink provides the Execution Order of the blocks.
In my model for some blocks the execution order is shown but for others it is not. I am curious why it is so? (why execution order of Sum and Relational Operators are not visible below?)

Answers (1)

It's possible that Simulink has determined that those blocks don't need to be executed (I think there is a Block Reduction optimization option). What happens if a Scope is attached to the output of a Sum block so that the Sum block must execute? Does that make that Sum block show up in the execution order?

5 Comments

I can't simulate this system in Matlab. This model is meant to be flashed on embedded target and then work there.
I guess attaching the scope would through an error. (I will try it and update here).
But if other blocks have execution orders shown without being simulated in simulink then why sum block and other blocks have an issue?
Why can't the system be simulated in Matlab/Simulink? Isn't that the first step before flashing to the embedded target?
I'm not suggesting attaching the scope for the production configuration, only as an experiment to see if doing so changes the execution order.
An alternative, and probably better, option would be to go to Information Overlays and click on "Reduced Blocks", if it's not grayed out, to see which blocks, if any, are not included in the model execution.
I agree that model should be first simulated before flashing. Unfortunately, the provided blocks that I am working with only take the hardware signal as input (and not able to take input from simulink sources). That's one of the reason that I resorted to Execution Order of my model's blocks.
Secondly, I don't see there is any option of "Reduced Blocks" in "Information Overlays" in Matlab R2020a.
Lastly, adding the scope and then checking for the Execution order of my model, I am wondering it might change the actual execution order (without scope).
Don't know when "Reduced Blocks" was added to Information Overlays. I'm using 2022a.
Again, adding the Scope is only intended as test to see if the block in quesition is being reduced out of model, in order to answer your question of why a block is not shown in the execution order. At this point, I'm only guessing that the blocks in question are being reduced out of the model.
Another option to determine if block reduction is causing the blocks in question to not be shown in the exeuction order is to turn off block reduction. In R2022a, block reduction can be turned off by going to
Model Settings -> Simulation Target -> Advanced Parameters
and uncheck Block Reduction. I assume it would be the same in 2020a
Here's the R2020a block reduction doc page with more information.
So, I placed the whole logic in question inside a Function call subsystem which is triggered by Function call generator and after that the Execution Order is visible as shown in the attached pic.

Sign in to comment.

Categories

Find more on Simulink Coder in Help Center and File Exchange

Products

Release

R2020a

Asked:

on 1 Jun 2023

Commented:

on 12 Feb 2024

Community Treasure Hunt

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

Start Hunting!