There are several ways of removing an application in Simulink Real-Time (SLRT):
(1) Using Simulink Real-Time Explorer
Right-click on the application in the Targets Tree in Simulink Real-Time Explorer and select 'Delete' as shown below:This context menu is available from R2021a only.
(2) Using Target Object Functions in MATLAB
(3) Using Software Update
When you update the software on the target computer, the process removes all target computer applications and the installed real-time application MLDATX files. To forces an update of the target software to the current version, run the following commands:
tg = slrealtime;
tg.update('force',true)
However, note that this method reboots the target and will therefore take a few seconds to complete.
(4) Using basic file operations
There is no documented or supported way of removing applications without using the Simulink Real-Time product, or using the Speedgoat target command-line. But you can try deleting the contents of the 'applications' folder via third-party tools using SSH or using file transfer protocols such as FTP or SCP.
By default, the applications folder is located under '/home/slrt/' and contains one subfolder for each installed application:
/home/slrt/applications/<model1>
/home/slrt/applications/<model2>
When deleting a model subfolder from the applications folder, make sure that:
- You use 'slrt' as username & password (not 'root').
- The application is not running or loaded at this time.
- The application is not used in a startup script.
On the target computer command line, the command to remove all applications would be:
rm -Rf /home/slrt/applications/*
You could achieve the same from within MATLAB by calling the PuTTY "plink" utility like this:
tg = slrealtime;
tg.stop
if strcmp(tg.status,'loaded')
tg.stop
end
if strcmp(tg.status,'stopped')
system('"C:\Program Files\PuTTY\plink.exe" -ssh -P 22 -pw slrt slrt@10.10.10.106 rm -Rf applications')
end
Note that using the SFTP/FTP functions shipped with basic MATLAB is not practical since they do not have a recursive remove directory option.
Please be aware that the solutions presented in item (4) are undocumented solutions and not a supported workflow. If you do choose to do this, you are doing this at your own risk.