Products & Services Solutions Academia Support User Community Company

Learn more about Simulink   

Environment Controller - Create branches of block diagram that apply only to simulation or only to code generation

Library

Signal Routing

Description

This block outputs the signal at its Sim port only if the model that contains it is being simulated. It outputs the signal at its RTW port only if code is being generated from the model. This allows you to create branches of a model's block diagram that apply only to simulation or only to code generation. The table below describes various scenarios where either the Sim or RTW port applies.

ScenarioOutput
Normal mode simulationSim
Accelerator mode simulationSim
Rapid Accelerator mode simulationRTW
Simulation of a referenced model (Normal or Accelerator modes)Sim
Simulation of a referenced model (Processor-in-the-loop (PIL) mode)RTW
(uses the same code generated for a referenced model)
External mode simulationRTW
Standard code generationRTW
Code generation of a referenced modelRTW

Real-Time Workshop software does not generate code for blocks connected to the Sim port if these conditions hold:

If you enable block reduction optimization, Simulink software eliminates blocks in the branch connected to the block's RTW port when compiling the model for simulation. For information about block reduction, see Block reduction in the online Simulink documentation.

Data Type Support

The Environment Controller block accepts signals of any data type supported by Simulink software. It outputs the type at its input.

Parameters and Dialog Box

Characteristics

Multidimensionalized

Yes

  


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