| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about Simulink |
Signal Routing

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.
| Scenario | Output |
|---|---|
| Normal mode simulation | Sim |
| Accelerator mode simulation | Sim |
| Rapid Accelerator mode simulation | RTW |
| 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 simulation | RTW |
| Standard code generation | RTW |
| Code generation of a referenced model | RTW |
Real-Time Workshop software does not generate code for blocks connected to the Sim port if these conditions hold:
You select the Inline parameters check box on the Optimization pane of the Configuration Parameters dialog box.
The blocks connected to the Sim port do not have external signals.
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.
Note Real-Time Workshop code generation eliminates the blocks connected to the Sim branch only if the Sim branch has the same signal dimensions as the RTW branch. Regardless of whether it eliminates the Sim branch, Real-Time Workshop uses the sample times on the Sim branch as well as the RTW branch to determine the fundamental sample time of the generated code and may, in some cases, generate sample-time handling code that applies only to sample times specified on the Sim branch. |
The Environment Controller block accepts signals of any data type supported by Simulink software. It outputs the type at its input.

Multidimensionalized | Yes |
![]() | Enumerated Constant | Extract Bits | ![]() |

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 |