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

18 Ansichten (letzte 30 Tage)
Can I access and download File Log data from my Speedgoat target when using a MATLAB Compiler  deployed standalone instrument panel 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'.
Even if I just try to open Simulation Data Inspector (SDI) from the standalone app, there will be an error:
Unable to resolve the name 'Simulink.sdi.view'.

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 26 Sep. 2023
Bearbeitet: MathWorks Support Team am 26 Sep. 2023
Most of the data streaming and logging methods in Simulink Real-Time rely on Simulation Data Inspector (SDI). This includes normal signal logging and the File Log block. Unfortunately, SDI has limited support for deployment. While it is possible to view live streaming data in a MATLAB app while the model is running, it is not possible to "log" it to a proper dataset.
Depending on the MATLAB release you are using to design and compile the app, here are the available options for file log handling:

File Log & Standalone 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" 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.
Note that you cannot open the actual SDI GUI to inspect the logged data from a standalone app.
New feature in R2023b: You can add a dedicated ImportFileLogButton button to your App Designer app to import a file log from a real-time application run to the host computer.

File Log & Standalone 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.
While not ideal, there is a potential workaround. 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 hard 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, please 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:

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by