Replace Matlab FCN with Stateflow Chart - Error

1 次查看(过去 30 天)
Hi Guys,
i replaced a working matlab fcn with a stateflow chart. To be honest i didnt expected any errors because it is very simple.
The Model looks like this:
Stateflow_Obere_Ebene.png
This is the Matlab fcn:
function [w_r,theta_r,iq_ref,motor_state] = fcn(ramp_endspeed,w_r_ramp,theta_r_ramp,w_r_foc,theta_r_foc,Iq_ref_foc,Iq_ramp,pre_motor_state)
if pre_motor_state == 1
w_e = w_e_ramp;
theta_e = theta_e_ramp;
Iq_ref = Iq_ramp;
if w_e_ramp >= ramp_endspeed
motor_state = 2;
else
motor_state = 1;
end
elseif pre_motor_state == 2
w_e = w_e_foc;
theta_e = theta_e_foc;
Iq_ref = Iq_ref_foc;
motor_state = 2;
else
w_e = 0;
theta_e = 0;
Iq_ref = 0;
motor_state = 1;
end
and then i build the statflow with the "classic" setting. But Simulink recommended me to use the "moore" setting.
So this is how it looks like:
in classic like this:
But the moore stateflow generates this error:
And im not understanding it.
Maby this input and output definitions could help u to understand my problem:
Inputs and outputs are the same in the Matlab fcn and stateflow. and the logic should be the same.
Thanks in advance.
Best regards

回答(1 个)

youjarr
youjarr 2019-6-17
No one a hint or an idea?

类别

Help CenterFile Exchange 中查找有关 Complex Logic 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by