Products & Services Solutions Academia Support User Community Company

Learn more about Simulink   

ssSetBlockReduction - Request that the Simulink engine attempt to reduce a block

Syntax

uint_T ssSetBlockReduction(SimStruct *S, unsigned int_T flag)

Arguments

S

SimStruct representing an S-Function block.

flag

If not zero, the Simulink engine should attempt to reduce this block.

Returns

0 if flag is 0 and 1, otherwise.

Description

Use this macro to ask the engine to reduce this block. A block is reducible if it can be eliminated from the model without affecting the model's behavior. The engine optimizes performance by skipping execution of reducible blocks during model simulation. In particular, the engine does not invoke the mdlStart, mdlUpdate, and mdlOutputs methods of reducible blocks. Further, the engine executes the mdlTerminate method of a reduced block only if the block has set the SS_OPTION_CALL_TERMINATE_ON_EXIT option before the simulation loop has begun, using ssSetOptions.

A block must meet certain criteria to be considered reducible. For example,

If a block fails to meet any of these criteria, the engine includes the block in the simulation regardless of whether the block has requested reduction.

See the Block reduction reference page in Simulink Graphical User Interface for further details. Note, if you want to enable dead branch elimination, do not request block reduction. Instead, set the SS_OPTION_NONVOLATILE option using ssSetOptions.

Your S-function must invoke this macro before the engine would otherwise invoke the S-function's mdlStart method (see the callback flow diagram in How the Simulink Engine Interacts with C S-Functions). This means your S-function must invoke this macro no later than its mdlSetWorkWidths method to be considered a candidate for block reduction.

Languages

C, C++

See Also

ssGetBlockReduction

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS