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.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1495109/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1495104/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1495109/image.png)
0 个评论
回答(1 个)
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 个评论
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 Center 和 File Exchange 中查找有关 Configure and View Diagnostics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!