How to stream live signal data from Simulink External Mode (ARM Linux RT) to a MATLAB App in real-time?
Show older comments
Hi everyone,
I am looking for a clean, built-in way to read live signal data from a Simulink model running in External Mode directly into an external MATLAB App (User GUI) application.
Our Setup:
- Target: ARM CPU running Linux (Real-Time Application)
- Host: PC running MATLAB 2022a / App Designer
- Connection: TCP/IP (External Mode is working perfectly)
The Goal:
I have several runtime signals inside the model (e.g., Boolean flags from "Compare to Constant" blocks, uint32 state machine indicators). I want to read these values in real-time inside my MATLAB App (e.g., via a cyclic timer or event listener) to update UI components like Lamps/LEDs and Status Texts while the external mode simulation is actively running.
What we have already tried (unsuccessfully):
- assignin with coder.extrinsic: Works perfectly in normal simulation, but is (as expected) ignored during code generation for the External Mode target.
- Signal Logging (logsout / SDI API): The logsout variable and standard SDI logs are only fully written to the Base Workspace after the simulation stops or pauses. It does not provide the live, sample-by-sample updates we need during active runtime.
- get_param(..., 'Value') on Display/Dashboard Blocks: We attempted to place Display or Dashboard Lamp blocks on the top level of the model to read them from the app. However, get_param returns NaN or static parameters because these blocks act as internal graphical viewers, rather than accessible data stores for external APIs.
- RuntimeObject on Outports: Fails because the subsystem outports are virtual blocks and do not possess an accessible run-time object on the host side during External Mode execution.
- Simulink.Signal / Data Store Memory: These objects manage metadata or internal target memory, but do not expose live runtime data to evalin or get_param from an external MATLAB app instance during External Mode.
The Question:
Since Simulink Scopes, Displays, and Dashboard blocks can stream and display these live runtime values from the ARM target onto the host, there must be an underlying streaming/subscriber mechanism within the Simulink engine.
Is there a native way, an undocumented command, or a specific API to tap into this active External Mode data stream from a MATLAB App without having to manually implement a custom UDP/TCP send/receive communication protocol block inside the target model?
Any insights, APIs, or workarounds would be highly appreciated!
Thank you in advance and with best greetings,
Lars
1 Comment
Raag
on 24 Jun 2026
Hi,
It is my understanding that you are trying to access live signal data from a Simulink model running in External Mode directly within a MATLAB App, without implementing custom communication blocks.
I recommend relying on the supported External Mode streaming and logging mechanisms, rather than attempting to access internal simulation data structures directly.
If near real-time access is required within your app, a practical approach is to consider custom communication interfaces to explicitly transfer the required signals from the target to the host environment.
You can refer to the following documentation for more information:
Answers (0)
Categories
Find more on Development Computer Setup in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!