Can I import and view File Log data from my Speedgoat target when using a MATLAB Compiler deployed SLRT app?

21 ビュー (過去 30 日間)
Can I access and download File Log data from my Speedgoat target using Simulink Real-Time (SLRT) when using a MATLAB Compiler deployed standalone SLRT app?
If I add "tg.FileLog.import" to the app code in R2022b or earlier, the file log import works fine when the app is not deployed. However, in the standalone app, the end user encounters the following error:
Unable to resolve the name 'Simulink.sdi.Instance.engine'.
When I try to add a call to Simulation Data Inspector (SDI) to the standalone app, there is the following warning during deployment:
In "mySLRTapp.mlapp", "Simulink.sdi.view" are excluded from packaging for the MATLAB Runtime environment according to the MATLAB Compiler license. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component.
While running the app, I get the following error:
Unable to resolve the name 'Simulink.sdi.view'.

採用された回答

MathWorks Support Team
MathWorks Support Team 2025 年 5 月 12 日
編集済み: MathWorks Support Team 2025 年 3 月 21 日
Most data logging methods in Simulink Real-Time use Simulation Data Inspector (SDI) infrastructure. This includes live streaming and importing log files created with File Log blocks. Unfortunately, SDI has limited support for deployment. While it is possible to view live streaming data in an SLRT app while the model is running (e.g. in Axes or other app components), it is not possible to record the signals to a dataset.
Depending on the MATLAB release you are using to design and compile the app, here are the available options for using File Log data.
 

File Log & Standalone SLRT App support in R2023a and newer

In R2023a and later, the SDI backend database is available for deployment, but SDI visualization is not yet possible.
This means you can use the File Log import function "tg.FileLog.import", or the ImportFileLogButton UI component (R2023b+), in a standalone app to download the log file to the SDI backend database. With this, you can:
  • Access the imported data using SDI APIs for custom plots or post-processing.
  • Export the imported data into a variable or .mat file using the slrealtime.exportRun API .
  • Other APIs such as "tg.FileLog.list" and "tg.FileLog.discard" should also work.
However, note that you cannot open the actual SDI GUI to inspect the logged data from a standalone app.

File Log & Standalone SLRT App support in R2022b and earlier

In R2022b and earlier, SDI cannot be deployed with MATLAB Compiler at all. This means it is not possible to access the streamed/logged data from a deployed application. Consequently, the regular file log import function "tg.FileLog.import" does not work in deployed standalone applications in R2022b and earlier.
In these releases you can use File Log blocks to log data and disable "AutoImportFileLog" when you start the application. This way, the File Log data will remain on the target PC's storage drive until it is manually downloaded. Since "tg.FileLog.import" does not work in deployed standalone applications in R2022b and earlier, you can try manually copying over the File Log files and then importing them to MATLAB later.
 
However, note that once the data is copied over, it can only be imported in a MATLAB session and not within a deployed app. The raw data can only be imported through SDI and not elsewhere. You can refer to the following documentation page for information on importing manually copied file logs:
The provided MATLAB Answers post also offers useful insights on the manual file log import workflow and how to use MATLAB's built-in "ftp" function for this purpose:

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeReal-Time Signal Logging and Streaming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by