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 comentarios

Mario Malic
Mario Malic el 14 de Nov. de 2020
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.
Samuel Synak
Samuel Synak el 14 de Nov. de 2020
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.

Iniciar sesión para comentar.

 Respuesta aceptada

Samuel Synak
Samuel Synak el 17 de Nov. de 2020
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 comentarios

巴依塔克 巴合提
巴依塔克 巴合提 el 18 de Nov. de 2022
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.
巴依塔克 巴合提
巴依塔克 巴合提 el 18 de Nov. de 2022
if you have a solution,please contact me 2241752161@qq.com

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Multicore Processor Targets en Centro de ayuda y File Exchange.

Preguntada:

el 14 de Nov. de 2020

Comentada:

el 18 de Nov. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by