Why can't I use the "Load Application" button in my deployed SLRT app to switch between MLDATX files to run on my Speedgoat target?
13 views (last 30 days)
Show older comments
MathWorks Support Team
on 20 Oct 2023
Edited: MathWorks Support Team
on 22 Mar 2025 at 22:41
I have created a GUI with App Designer to interact with a Simulink Real-Time (SLRT) simulation running on my Speedgoat target. When running the app in MATLAB, I can switch between multiple MLDATX real-time application files to run on my Speedgoat using the "Load Real-Time Application" dialog:

Then, I packaged this app into a standalone executable using MATLAB Compiler. However, when I try to click the "Load Application" button in the deployed SLRT app, either nothing happens (no dialog opens), or the following error occurs when attempting to load the MLDATX file:
Dot indexing into the result of a function call requires parentheses after the function name. The supported syntax is 'sIrealtime().internal'.
Since R2024a:
Error communicating with target 'xx.xx.xx.xx': Specify the real-time application name in the 'Application' property of the Load Button component in the instrument panel app.
I also tried to implement a manual logic in my app using app.tg.load() that switches between MLDATX files of the same name located in different folders. This works when launching the app from MATLAB, but not when it's deployed.
Accepted Answer
MathWorks Support Team
on 22 Mar 2025 at 0:00
Edited: MathWorks Support Team
on 22 Mar 2025 at 22:41
This is a limitation of Simulink Real-Time (SLRT). Standalone SLRT apps created with MATLAB Compiler can only be used with a single MLDATX file. For this reason, the dialog to browse for an MLDATX file is disabled when clicking the "Load Application" button in a deployed SLRT app.
The name of the MLDATX file must be specified in the app code before compiling it into a standalone executable.
To achieve this, you can pass the MLDATX name to the LoadButton object's "Application" property in the app startupFcn(), as suggested below:
properties (Access = private)
SLRTApp = 'slrt_ex_pendulum_100Hz'
%<...>
end
methods (Access = private)
function startupFcn(app)
app.LoadButton.Application = app.SLRTApp;
%<...>
end
end
This way, clicking the "Load Application" button loads the single MLDATX file directly without an additional dialog.
You can find an example app with code that is ready for deployment in Add App Designer App to Inverted Pendulum Model.
NOTE: When compiling the app, make sure the MLDATX file is in the same folder as the MLAPP file and added to the deployable archive. See this MATLAB answer for details: Why do I get the error "Real-time application was not included in the standalone executable" with my deployed SLRT app?
Additional Notes:
1. For apps created using the SLRT App Generator, starting from R2022b, the "Application" property will automatically be specified for the "LoadButton" object.
2. To switch between MLDATX files for fast design iterations, you can use a minimal installation of the two products MATLAB and Simulink Real-Time, as per our Test Operator license model. For more information on this, see: What are the available interfaces and APIs to interact with Speedgoat & Simulink Real-Time as a Test Engineer in R2020b or later?
0 Comments
More Answers (0)
See Also
Categories
Find more on Real-Time Application Instrument Panel Apps 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!