Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Turning off Simulink blocks

396 views
Skip to first unread message

Stephen Reiman

unread,
Nov 16, 2006, 1:11:58 PM11/16/06
to
I would like to turn off some of the scopes within a simulink model
file so they don't take up resources. I don't need the displays
current, but I may in the future and I don't want to delete them from
the model. Similar to how one can comment out a line within Matlab
and keep it from executing without removing it from the code. Is
there anything similar to commenting within Simulink so that I can
keep a block from executing without having to remove it from from the
model?

Ingo Stuermer

unread,
Nov 17, 2006, 5:46:09 AM11/17/06
to
Stephen,

A good way to "comment out" Simulink blocks is to use a switch block
whose control port is driven by a global constant value (parameter).
Say PARA=1 if you want to have this Simulink block in your code and
PARA=0 if you want to comment it out.
Choose the threshold of your switch w.r.t the value of PARA.
The first branch of the switch should pass the original signal to the
Simulink block you want to have. The other should end at a terminator
block. In this case, no code is executed for the Simulink block you
want to comment out.
And if you use a code generator, the code generator can decide in
advance, whether you want to generate code for this block or not
(depending on the value of PARA).

Hope you got the idea?!

Kind regards,
Ingo Stuermer
<http://www.ichmaschine.de>

K E

unread,
Feb 23, 2012, 12:44:17 PM2/23/12
to
> The first branch of the switch should pass the original signal to the
> Simulink block you want to have. The other should end at a terminator
> block.

I am having trouble implementing this. The terminator block only accepts inputs and does not provide an output that can pass through the switch. Can you give more details?

K E

unread,
Feb 23, 2012, 1:10:34 PM2/23/12
to
I understand now. PARA should be passed into a 'SwitchCase' block. If PARA=1, the signal passes through to the block to be executed. If PARA~=1, the signal passes through to the 'Terminator' block.
But in my case, the commented block is a 'Scope'. If PARA=1, how do I provide the signals (Position and Velocity) that I want to plot in the scope? It seems like only PARA gets passed to the Scope.
0 new messages