Error running Simulink model from compiled App Designer GUI

I have a very simple App Designer project that highlights a problem I'm having after compiling other more complicated App Designer projects into a standalone app.
The following runs without any issues when run from the App Designer enviornment. I'm simply passing a block parameter value into Simulink using 'set_param', running the model, obtaining and graphing the output data from the model.
The following is invoked by a button press callback in my App Designer Code
% Button pushed function: RunSimButton
function RunSimButtonPushed(app, event)
%Simulink Model Name & Sim Time
Model_Name='SimModelDebug_01';
Simulation_Time=app.SimTimeSpinner.Value;
%get amplitude value from user
AmplitudeValue= string(app.SineWaveAmplitudeSpinner.Value);
%update block value in model
set_param('SimModelDebug_01/SineWave','Amplitude', AmplitudeValue)
%run Simulink model
SimOut=sim(Model_Name,Simulation_Time);
%Get values back in from model
Wave=SimOut.Wave;
Time=Wave.Time;
WaveData=Wave.Data;
%plot sim data to GUI
plot(app.UIAxes,Time,WaveData);
end
However, when I compile the app and try to run it from the standalone program I get the following errors and the app will not run.
Error using SimDebug/RunSimButtonPushed (line 30)
SlProxy service unavailable.
Error in appdesigner.internal.service.AppManagementService/tryCallback (line 369)
Error in matlab.apps.AppBase>@(source,event)tryCallback(appdesigner.internal.service.AppManagementService.instance(),app,callback,requiresEventData,event) (line 37)
Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 410)
Error while evaluating Button PrivateButtonPushedFcn.
Any help would be greatly appreciated!!!!

 Akzeptierte Antwort

Merritt Blackburn
Merritt Blackburn am 7 Sep. 2021

0 Stimmen

To run compiled App Designer projects that contain Simulink models as standalone applications Simulink compiler in addition to MATLAB compiler is required to do so.

Weitere Antworten (0)

Kategorien

Mehr zu Using MATLAB Projects in Simulink finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by