How to Use Goto and From Blocks in Simulink
In Simulink, use
Goto blocks to send signals without direct lines and From blocks to receive those signals elsewhere in the model. This helps keep your diagrams clean by avoiding long connecting lines between blocks.Syntax
The Goto block sends a signal with a specified tag name, and the From block receives the signal using the same tag name. Both blocks must share the exact tag to connect signals.
- Goto block: Set the
Goto Tagparameter to name the signal. - From block: Set the
Goto Tagparameter to the same name to receive the signal.
simulink
Goto Tag: "signal1" From Tag: "signal1"
Example
This example shows a simple Simulink model where a signal from a Sine Wave block is sent using a Goto block and received by a From block connected to a Scope block for visualization.
plaintext
1. Add a <code>Sine Wave</code> block. 2. Connect it to a <code>Goto</code> block with tag "sineSignal". 3. Add a <code>From</code> block with tag "sineSignal". 4. Connect the <code>From</code> block to a <code>Scope</code> block. 5. Run the simulation to see the sine wave on the scope.
Output
The Scope block displays the sine wave signal sent via the Goto and From blocks.
Common Pitfalls
- Using different tag names in Goto and From blocks breaks the connection.
- Placing Goto and From blocks in different subsystems without proper visibility settings can cause signal loss.
- Overusing Goto/From blocks can make the model harder to follow if not documented well.
simulink
Wrong: Goto Tag: "signalA" From Tag: "signalB" Right: Goto Tag: "signalA" From Tag: "signalA"
Quick Reference
| Block | Purpose | Key Parameter |
|---|---|---|
| Goto | Sends signal using a tag | Goto Tag (signal name) |
| From | Receives signal by tag | Goto Tag (must match Goto) |
Key Takeaways
Use matching tag names in Goto and From blocks to connect signals.
Goto and From blocks help reduce clutter by avoiding long signal lines.
Ensure visibility settings allow signal access across subsystems.
Avoid excessive use to keep models readable and maintainable.