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

조회 수: 49 (최근 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.

답변 (2개)

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.

댓글을 달려면 로그인하십시오.


Song-Hyun Ji
Song-Hyun Ji 2025년 3월 28일

카테고리

Help CenterFile Exchange에서 Modeling에 대해 자세히 알아보기

태그

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by