matlab function block Used for C code generation Error?

matlab function block Used for C code generation with "Only one inport and one outport can share the same parameter name." Error?
I can't see any error when I open the report, but the "diagnostic viewer" shows an error, see the picture below, I don't know how to change it to pass? Thanks in advance!
My function signature is:
[ timeStampOut,pathFound,poseOutCurrentInGlobal] = routePlanningEntry( deltaX,deltaY,timeStampIn,imgGrayIn,xEgoInGloabalWorld,...
yEgoInGloabalWorld,thetaEgoInGloabalWorld,direction,laneIn,UltrosonicData)%#codegen
run in MATLAB 2021a

댓글 수: 6

Walter Roberson
Walter Roberson 2022년 3월 9일
편집: Walter Roberson 2022년 3월 9일
I wonder if you are encountering limitations on the length of variable names, under the speculation that maybe your model name is being used used as a prefix for the variable names? ANSI recognizes at least 31 characters in variable names.
If my speculation has any truth then of you rename your model to a short name then it might work.
xingxingcui
xingxingcui 2022년 3월 9일
편집: xingxingcui 2022년 3월 9일
Thank you for your reply, my model name is 'fadsPathPlan20220309', there is no variable inside the function using the model name as prefix, I tried to change 'fadsPathPlan20220309' to a shorter name, like 'fadsPathPlan', and still report the same error, I don't know how to pass it next (on the contrary, matlab coder can pass it), do you have any other possible solution? @Walter Roberson
If you use the Port Manager for the MATLAB Function Block, then what does it show as the port names?
In my experience, if there was a mismatch between the name in the port manager and the code in the function signature, then when you update the model it would change the code to match the port manager.
"In my experience, if there was a mismatch between the name in the port manager and the code in the function signature, then when you update the model it would change the code to match the port manager."
Right, currently Port Manager for the MATLAB Function Block is consistent with the function signature, but it still reports this error
Can you post the model in question?
@Benjamin Thompson I'm sorry for the late reply, my problem is solved, this model is built in R2019b version, in R2021a run always reported an error above, but I recreate the same model in R2021a, surprisingly no error, success, should be the new version is not compatible with the old version of the model problem

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기

제품

릴리스

R2021a

질문:

2022년 3월 9일

댓글:

2022년 3월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by