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!!!!

 채택된 답변

Merritt Blackburn
Merritt Blackburn 2021년 9월 7일

0 개 추천

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.

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Simulink Compiler에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by