Bird
Raised Fist0
Simulinkdata~10 mins

Referenced models in Simulink - Step-by-Step Execution

Choose your learning style10 modes available
Concept Flow - Referenced models
Start: Main Model
↓
Insert Reference Block
↓
Link to Submodel
↓
Simulate Main Model
↓
Referenced Model Executes
↓
Output from Submodel
↓
Main Model Continues
↓
Simulation Ends
The main model includes a reference block that links to a submodel. When the main model runs, it calls the referenced model, gets its output, and continues.
Execution Sample
Simulink
MainModel
  ReferenceBlock -> SubModel
  Simulate MainModel
  Output = SubModel output
This shows the main model calling a referenced submodel during simulation and receiving its output.
Execution Table
StepActionModel ExecutedOutput ProducedNext Step
1Start simulationMainModelNo output yetCall ReferenceBlock
2ReferenceBlock callsSubModelNo output yetRun SubModel simulation
3SubModel runsSubModelGenerates output dataReturn output to MainModel
4Output receivedMainModelReceives SubModel outputContinue MainModel simulation
5MainModel completesMainModelFinal output readySimulation ends
💡 Simulation ends after MainModel completes with referenced model output integrated
Variable Tracker
VariableStartAfter Step 2After Step 3After Step 4Final
MainModel_stateIdleCalling SubModelWaiting for outputReceived outputCompleted
SubModel_stateIdleRunningOutput generatedReturned outputIdle
Output_dataNoneNoneProducedPassed to MainModelFinal output
Key Moments - 2 Insights
Why does the main model wait during the referenced model execution?
Because the main model calls the referenced model and must wait for its output before continuing, as shown in steps 2 and 3 of the execution table.
Is the referenced model simulation independent or integrated?
It runs as part of the main model simulation but separately inside the reference block, producing output that the main model uses next (steps 3 and 4).
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, at which step does the referenced model produce output?
AStep 2
BStep 4
CStep 3
DStep 5
💡 Hint
Check the 'Output Produced' column in the execution table for step 3.
According to the variable tracker, what is the state of MainModel after step 4?
AReceived output
BCalling SubModel
CIdle
DCompleted
💡 Hint
Look at the 'MainModel_state' row under 'After Step 4' in the variable tracker.
If the referenced model did not produce output, what would happen in the main model?
AMain model continues without output
BMain model waits indefinitely
CSimulation ends immediately
DReferenced model restarts automatically
💡 Hint
Refer to the execution table steps 2 and 3 where main model waits for output.
Concept Snapshot
Referenced models in Simulink allow a main model to include and run a separate submodel.
The main model calls the referenced model during simulation.
The referenced model runs independently but returns output to the main model.
This helps organize complex systems by breaking them into smaller parts.
Simulation waits for referenced model output before continuing.
Use Reference blocks to link models cleanly.
Full Transcript
Referenced models in Simulink let you build a main model that includes other models as parts. The main model uses a Reference block to call a submodel. When you run the main model, it pauses to run the referenced model. The referenced model runs its simulation and produces output. This output is sent back to the main model. Then the main model continues running with that output. This way, you can organize big systems into smaller, manageable pieces. The execution table shows each step: starting the main model, calling the referenced model, running it, getting output, and finishing. The variable tracker shows how the states of the main and referenced models change during simulation. Understanding this flow helps you build clear and efficient Simulink models.

Practice

(1/5)
1. What is the main purpose of using Referenced models in Simulink?
easy
A. To reuse parts of models and simplify large projects
B. To create new Simulink blocks from scratch
C. To export models as images
D. To run simulations faster by skipping blocks

Solution

  1. Step 1: Understand the role of referenced models

    Referenced models allow you to include one model inside another, making reuse possible.
  2. Step 2: Connect reuse to project management

    By reusing parts, you keep big projects organized and easier to update.
  3. Final Answer:

    To reuse parts of models and simplify large projects -> Option A
  4. Quick Check:

    Referenced models = reuse and simplify [OK]
Hint: Think reuse and organization for big Simulink projects [OK]
Common Mistakes:
  • Confusing referenced models with creating new blocks
  • Thinking referenced models speed up simulation by skipping
  • Assuming referenced models export images
2. Which of the following is the correct way to add a referenced model in Simulink?
easy
A. Drag a Model block and set its Model name parameter to the referenced model file
B. Use the MATLAB command add_block('model') without parameters
C. Copy and paste the entire model into the current model
D. Create a new subsystem and name it after the referenced model

Solution

  1. Step 1: Recall how to include referenced models

    Simulink uses Model blocks to include referenced models by specifying the model file name.
  2. Step 2: Check options for correctness

    Drag a Model block and set its Model name parameter to the referenced model file correctly describes dragging a Model block and setting its Model name parameter.
  3. Final Answer:

    Drag a Model block and set its Model name parameter to the referenced model file -> Option A
  4. Quick Check:

    Model block + Model name = referenced model [OK]
Hint: Use Model block and set model name to reference [OK]
Common Mistakes:
  • Using add_block without parameters causes errors
  • Copy-pasting duplicates instead of referencing
  • Naming subsystems does not create references
3. Given a Simulink model with a Model block referencing subsystemA, what happens if subsystemA is updated externally and saved before simulation?
medium
A. Simulation fails with an error about missing blocks
B. The main model ignores changes and uses the old version
C. The main model uses the updated subsystemA during simulation
D. The referenced model is duplicated inside the main model automatically

Solution

  1. Step 1: Understand referenced model behavior on update

    Referenced models reflect changes made externally when saved before simulation.
  2. Step 2: Analyze simulation effect

    The main model uses the latest saved version of the referenced model during simulation.
  3. Final Answer:

    The main model uses the updated subsystemA during simulation -> Option C
  4. Quick Check:

    Referenced models update = main model uses latest [OK]
Hint: Referenced models always use saved latest version at simulation [OK]
Common Mistakes:
  • Assuming main model caches old referenced model version
  • Thinking simulation fails if referenced model changes
  • Believing referenced models duplicate automatically
4. You added a referenced model block but get an error: Model file not found. What is the most likely cause?
medium
A. The simulation time is set to zero
B. The referenced model file path is incorrect or missing
C. The referenced model has no input ports
D. The main model is not saved

Solution

  1. Step 1: Identify cause of 'Model file not found'

    This error usually means Simulink cannot locate the referenced model file due to wrong or missing path.
  2. Step 2: Check other options for relevance

    Saving main model, input ports, or simulation time do not cause this error.
  3. Final Answer:

    The referenced model file path is incorrect or missing -> Option B
  4. Quick Check:

    File not found = wrong or missing path [OK]
Hint: Check referenced model file path if 'not found' error appears [OK]
Common Mistakes:
  • Ignoring file path issues
  • Blaming simulation time or ports incorrectly
  • Not saving main model but error is unrelated
5. You want to create a large Simulink project with multiple teams working on different parts. How do referenced models help in this scenario?
hard
A. Referenced models run simulations independently without integration
B. Referenced models automatically merge all team changes into one file
C. Referenced models prevent any changes once included in the main model
D. Each team works on separate referenced models that are included in the main model, easing collaboration

Solution

  1. Step 1: Understand team collaboration with referenced models

    Referenced models allow teams to work on separate model files independently.
  2. Step 2: Connect referenced models to main model integration

    The main model includes these referenced models, making integration easier and organized.
  3. Final Answer:

    Each team works on separate referenced models that are included in the main model, easing collaboration -> Option D
  4. Quick Check:

    Referenced models = team collaboration and modular design [OK]
Hint: Use referenced models for modular teamwork in big projects [OK]
Common Mistakes:
  • Thinking referenced models merge files automatically
  • Assuming referenced models lock changes
  • Believing referenced models simulate independently without integration
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard