How can I control the number of file logs stored on my Speedgoat target machine?

9 views (last 30 days)
I use File Logs for file logging with Simulink Real-Time (SLRT) in R2020b and later.
How can I control the number of file logs stored on the SSD hard disk of my Speedgoat target machine?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 18 Mar 2024
Edited: MathWorks Support Team on 18 Mar 2024
By default, the maximum number of file logs stored on the target is set to one log per application.
Note that the maximum number of file log runs is always defined for each real-time application. There is no way to set a global maximum of file logs on the target.
There are 3 different ways to change the number of file logs retained per application:
  1. In the model (requires a rebuild)
  2. In the MLDATX file
  3. When starting the application

1. In the model (requires a rebuild)

Use the "Max file log runs" option in the "Simulink Real-Time Options" section of your model's configuration parameters to set the maximum number of file log runs for your application:
Then, rebuild the model to create an updated real-time application MLDATX file for the change to take effect.
See the following documentation to learn more about the 'SLRTFileLogMaxRuns' model parameter:
https://www.mathworks.com/help/slrealtime/ref/maxfilelogruns.html

2. In the MLDATX file

If you do not have access to the model, or would like to avoid a rebuild, you can modify the 'fileLogMaxRuns' real-time application option for the MLDATX file. This will override the "Max file log runs" option specified in the model parameters. Then, reload the real-time application MLDATX file to the target for the change to take effect.
You can do this programmatically using slrealtime.Application:
>> app = slrealtime.Application('slrt_ex_osc');
>> app.Options.set('fileLogMaxRuns',4); % set max number of file logs
>> tg = slrealtime;
>> tg.load('slrt_ex_osc');
>> tg.start('AutoImportFileLog',false);
In R2023b and later, the same can be done interactively using the "Simulink Real-Time Application Property Inspector". To open it, simply double-click the MLDATX file in MATLAB Current Window browser. Open the "Options" tab and modify the "Max file log runs" option. Then, click "Save". Optionally, you can also "Run" the application:
Important note: You can inadvertently delete existing file logs for an installed real-time application on the target computer if you change 'fileLogMaxRuns' using slrealtime.Application or the Application Property Inspector, and then reload the application. To change the number of stored logs without deleting existing logs, use the start option as shown in the next section.
See the following documentation to learn more about the 'fileLogMaxRuns' real-time application option:https://www.mathworks.com/help/slrealtime/api/slrealtime.application.html#mw_10b36e10-d68f-4caf-a68a-ceecbaa672b2  
See the following documentation to learn more about the new Simulink Real-Time Application Property Inspector:https://www.mathworks.com/help/slrealtime/ref/simulinkrealtimeapplicationpropertyinspector-app.html

3. When starting the application

For an existing real-time application installed on the target machine, after loading the application, you can use the 'FileLogMaxRuns' start option. This will override the "Max file log runs" specified in the model parameters and 'fileLogMaxRuns' real-time application option applied to the MLDATX file.
>> tg = slrealtime;
>> tg.load('slrt_ex_osc');
>> tg.start('FileLogMaxRuns', 4, 'AutoImportFileLog',false);
See the following documentation to learn more about the 'FileLogMaxRuns' start option:

More Answers (0)

Categories

Find more on Troubleshooting in Simulink Real-Time 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!