Replace Matlab FCN with Stateflow Chart - Error

2 ビュー (過去 30 日間)
youjarr
youjarr 2019 年 6 月 14 日
回答済み: youjarr 2019 年 6 月 17 日
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 Center および File ExchangeComplex Logic についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by