- MATLAB Compiler Support for MATLAB, Simulink, and Toolboxes
- Functions Not Supported for Compilation by MATLAB Compiler
Best practices & tips for creating standalone SLRT apps for interaction with Speedgoat using App Designer & MATLAB Compiler
23 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
MathWorks Support Team
il 25 Ott 2023
Modificato: MathWorks Support Team
il 23 Ott 2025 alle 11:12
What are some best practices & tips for creating standalone Simulink Real-Time (SLRT) apps to control real-time application running on Speedgoat hardware with MATLAB Compiler & App Designer?
Risposta accettata
MathWorks Support Team
il 23 Ott 2025 alle 0:00
Modificato: MathWorks Support Team
il 23 Ott 2025 alle 11:12
To get started, here are some general tips for creating an SLRT app:
However, there are features that work within MATLAB, but not in standalone apps deployed with MATLAB Compiler that you need to keep in mind. Here are general lists of unsupported toolboxes, GUIs, tools, and functions with MATLAB Compiler:
Below is a collection of tips that are particularly relevant when creating standalone SLRT apps:
1. Upgrade to R2024b. App Designer support for SLRT has received several new features and we strongly recommend using a recent MATLAB release if possible. For a summary of the latest updates, see the SLRT Release Notes. Using the latest release also ensures that you benefit from continuous enhancements in App Designer app performance and responsiveness.
2. Simulation Data Inspector (SDI) is not deployable: One important limitation of MATLAB Compiler is that the Simulation Data Inspector (SDI) frontend GUI cannot be used in standalone apps. Use the "connectLine" functionality instead to display signals in Axes in your app. To log signals for later import, use File Logging, and take note of the limitation described in section 3.
3. File Logging limitations: Due to the unavailable SDI frontend, there are other important considerations when your model includes File Log blocks for signal logging. For more information, see: Can I import and view File Log data from my Speedgoat target when using a MATLAB Compiler deployed SLRT app?
4. Data Dictionaries are not deployable: Data Dictionaries (*.sldd) are not supported for deployment with MATLAB Compiler either. This can cause an issue if, for example, your app needs to access enum definitions from a data dictionary, as this will not work in the standalone application. Define the enums in an M-file instead.
5. Load Application button limitation: In a deployed SLRT app, the dialog to browse for a real-time application MLDATX file is not supported when clicking the "Load Application" button. Instead, the name of the MLDATX file must be specified in the app code before compiling it into a standalone executable. Only a single MLDATX file can be used. For details, see: 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?
6. 'TargetSource' properties for your SLRT UI components: If there is a TargetSelector UI component in your app, make sure that all other SLRT UI components point to that TargetSelector by using the 'TargetSource' property. For more information, see slrealtime.ui Properties.
7. Target Selector drop-down & target IP address: Note that the TargetSelector drop-down will not work in a standalone app. In R2022b and later, the TargetSelector turns into an edit field so the app user can enter a target IP address. Alternatively, the target IP address must be specified in the app code using the "slrealtime" target object. For details, see: Why do I get a "Target IP Address is empty" error when I try to connect to Speedgoat hardware from a deployed SLRT app?
8. Tips for using the Application Compiler with SLRT: After opening the Application Compiler for the first time and selecting the *.mlapp file, wait for 30-60 seconds until the Application Compiler has finished the dependency analysis and determined that the app requires the SLRT Target Support Package. For details, see: Why do I get the error "Function requires Simulink Real-Time Target Support Package" with my deployed SLRT app?
Also, make sure to add the MLDATX application file under the "Files required for your application to run" section since it must be packaged into the application.
9. Ensure the end user has the correct MATLAB Runtime version & update installed: To run an SLRT app on a host computer without a MATLAB installation, it is necessary to install MATLAB Runtime. For an SLRT app, it is recommended that the MATLAB Runtime release version and update version should match the version of MATLAB that was used to create the standalone application. The easiest way to ensure a matching MATLAB Runtime is to package the runtime installer into the standalone application; however, increasing IT restrictions might make this workflow difficult for both the developer of the SLRT app, and the end user of the app. If you distribute your standalone SLRT app without the runtime installer packaged in it, it is best to provide a direct link to the matching runtime installer:
https://ssd.mathworks.com/supportfiles/downloads/R20XXx/Release/Y/deployment_files/installer/complete/win64/MATLAB_Runtime_R20XXx_Update_Y_win64.zip
Where "R20XXx" is the number of the major release version (e.g. "R2022b") and "Y" is the update version, as per the "version" MATLAB command.
10. Allow the standalone SLRT app through the firewall: If the host computer where the SLRT app is run has a firewall or antivirus software in place, it may be necessary to allow the app (*.exe) through the firewall to ensure smooth communication between the host and Speedgoat target. Refer to the following page for instructions regarding Windows Firewall: How do I configure Windows Defender Firewall for MATLAB to communicate with external hardware such as Speedgoat?
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Target Computer Setup in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!