App designer model update error

Hi,
i have a problem with one error, that MATLAB is reporting to me. Error message:
"Warning: In rapid accelerator mode, when the simulation is started from the command line, visualization blocks are not updated. If the simulation is started from the toolstrip, visualization blocks are updated.
I am working on app, that can run simulation and plot response of control system, but I am stuck on this error message.
This is part of my code in AppDesigner:
mdl = 'time_delay_filter';
in = Simulink.SimulationInput(mdl);
in = in.setModelParameter('StopTime','30');
in.ExternalInput = app.externalInput();
k=app.kEditField.Value;
T=app.TEditField.Value;
L=app.LEditField.Value;
s4 = -(3/L)-(1/(2*T))+sqrt((3/(L.^2))+(1/(4*(T.^2))));
Kp = (1/k)*((L.^2)*T*(s4.^3) + L*(3*T+L)*(s4.^2) + L*s4 - 1)*exp(L*s4);
Ti = -2*(((L.^2)*T*(s4.^3) + L*(3*T+L)*(s4.^2) + L*s4-1)/((s4.^3)*L*(L*T*s4 + 2*T + L)));
Td = (-1/2)*(((L.^2)*T*(s4.^2) + L*(4*T+L)*s4 + 2*L + 2*T)/((L.^2)*T*(s4.^3) + L*(3*T+L)*(s4.^2) + L*s4 - 1));
b=min(2/(Ti*abs(s4)),1);
c=min(1/(Ti*(s4^2)*Td),1);
Kd= Kp*Td;
Ki=Kp/Ti;
in = in.setVariable('b',b);
in = in.setVariable('c',c);
in = in.setVariable('s4',s4);
in = in.setVariable('Kp',Kp);
in = in.setVariable('Ki',Ki);
in = in.setVariable('Kd',Kd);
in = in.setVariable('L',L);
in = in.setVariable('k',k);
in = in.setVariable('T',T);
in = simulink.compiler.configureForDeployment(in);
simOut=sim(in);
plot(app.UIAxes,simOut.ScopeData.time,simOut.ScopeData.signals.values);
Can please somebody help me ?
Thank you.

2 Comments

Hello,
It's warning, not an error message, your simulations should work.
I briefly checked what Rapid Accelerator, and I don't think your are able to process simulations in parallel easily. Did you want to do it with Rapid Accelerator (maybe it's on by default)? You might have to do something similar to this.
It's best to ask customer service.
Hi, thanks for your answer. Yeah, you are right.. warning.. It quite works.. but the graph of response is not correct. Totaly different. There is something wrong with parameters in blocks. When i simulate it without one block, it works fine.. about these modes.. I dont really know what is this rapid acceleration, but i tried to change it on 'Normal'. But it is still the same.

Sign in to comment.

 Accepted Answer

So i solved it. There is no need to compile it like this:
in= simulink.compiler.configureForDeployment(in)
and creating some rapid accelerator things.
I just loaded the model into app like this:
load_system('my_model');
% now set your paremeters

2 Comments

can this work with standalone app?I mean Stand-alone desktop software,I have same problem as yours,and my aim is to have standalone app ,that can run without matlab.
if you have a solution,please contact me 2241752161@qq.com

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!