Skip to Main Content Skip to Search
Product Documentation

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 Coder port only if code is being generated from the model. This option enables you to create branches of a block diagram that apply only to simulation or code generation. The table below describes various scenarios where either the Sim or Coder port applies.

ScenarioOutput
Normal mode simulationSim
Accelerator mode simulationSim
Rapid Accelerator mode simulationCoder
Simulation of a referenced model (Normal or Accelerator modes)Sim
Simulation of a referenced model (Processor-in-the-loop (PIL) mode)Coder
(uses the same code generated for a referenced model)
External mode simulationCoder
Standard code generationCoder
Code generation of a referenced modelCoder

Simulink Coder software does not generate code for blocks connected to the Sim port if these conditions hold:

If you enable block reduction optimization, Simulink eliminates blocks in the branch connected to the Coder 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 that Simulink supports. The output uses the same data type as the input.

For more information, see Data Types Supported by Simulink in the Simulink documentation.

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-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS