Simulink If block error "Port 1 must directly or indirectly connect to one If Action Subsystem"

63 次查看(过去 30 天)
Hello, I am working to use an If block and If action blocks to set shift points for a vehicle model, the code that I am going after would be:
If u1 > 57.3421
6th Gear If Action Block activated
elseif u1 > 46.2345
5th Gear If Action Block activated
elseif u1 > 35.9144
4th Gear If Action Block activated
elseif u1 > 25.6962
3rd Gear If Action Block activated
elseif u1 > 4.2575
2nd Gear If Action Block activated
else
1st Gear If Action Block activated
end
but I keep recieving an error that Port 1 must be connected to an If action block. Any suggestions on how to fix this?
Attached are pictures of the example I was using to build this and the model I have created.

回答(1 个)

Fangjun Jiang
Fangjun Jiang 2023-9-28
编辑:Fangjun Jiang 2023-9-28
Outport 1 of the If block is also connected to another destination but it was not shown in the snapshot. Dis-connect that branch and do the same for the rest.
Outputs from the if, else, and elseif ports are action signals to If Action Subsystem blocks. They can't be connected to other places.
  2 个评论
John Harrison
John Harrison 2023-9-28
Thank you, I had those ports connected to other If Action subsystem blocks, but after reworking the system so one If port goes to one if Action block it worked.
Fangjun Jiang
Fangjun Jiang 2023-9-28
The trigger signals can only be connected to one destination. That was my impression and I suspect that was the cause of your issue. But I couldn't find any statement on this from the Simulink document.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Configure and View Diagnostics 的更多信息

标签

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by