How do I remove a real-time application from the Speedgoat target file system?

How do I remove a real-time application from the Speedgoat target file system?

 Accepted Answer

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.
Refer to the following documentation page for more details on SLRT Explorer:https://www.mathworks.com/help/slrealtime/ref/simulinkrealtimeexplorer-app.html 
 

(2) Using Target Object Functions in MATLAB

Starting in R2022a, there is a "removeApplication" function to remove a real-time application from the Speedgoat target:https://www.mathworks.com/help/slrealtime/api/slrealtime.target.removeapplication.html
In R2022b, an additional "removeAllApplications" function was added to remove all applications from the target:https://www.mathworks.com/help/slrealtime/api/slrealtime.target.removeallapplications.html 
 

(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:
  1. You use 'slrt' as username & password (not 'root').
  2. The application is not running or loaded at this time.
  3. 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;
% Stop and/or unload current application
tg.stop
% In case the application was auto-reloaded, repeat tg.stop to unload
if strcmp(tg.status,'loaded')
    tg.stop
end
% Call PuTTY 'plink' utility to send "rm -Rf applications" command to target
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.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!