Simulink Coder external mode error: Simulink cannot upload data to xxx because one of its driving blocks is a top level inport

5 views (last 30 days)
I have one inport connected to the scope, and I generated the code and run it in external model. I got this error below, and the scope is not showing any results. I cannot find any answers from the internet. Did I do anything wrong? What is the general suggestions?

Answers (1)

Hari
Hari on 10 Jan 2024
Hi Tao Cui,
I understand that you are encountering an error with Simulink Coder's external mode stating that Simulink cannot upload data because one of its driving blocks is a top-level inport.
To troubleshoot the error you can use Data Store Read and Data Store Write blocks to pass data between the inport and the scope.
Here's how you can implement the Data Store Memory method:
  1. Add a Data Store Memory block to your model.
  2. Add a Data Store Write block connected to the inport that writes to the Data Store Memory.
  3. Add a Data Store Read block connected to the scope that reads from the Data Store Memory.
Refer to the documentation of Data Store Memory for more information on how to use it within your Simulink model:
Hope this helps!

Categories

Find more on Simulink Coder in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!