"Unable to read some Variables" error when converting to FMU
조회 수: 11 (최근 30일)
이전 댓글 표시
I am able to compile my model successfully and it is giving the expected results. However on trying to convert it to an FMU, I am getting an error "=== Export to Standalone Co-Simulation FMU (Elapsed: 0.76 sec) ===
Error:Unable to read some variables. Variable name lengths must be less than or equal to MATLAB maximum name length of 63 characters.
".
However on checking the variable names in my model, I found out that the variable with the longest name is only 40 characters which is well below the 63 character limit that Matlab enforces. I was able to successfully convert my model into an FMU several times in the past and the only change made in the model now, is an additional input port (whose name length is 11) and an additional output port (whose name length is 6). I tried undoing these changes and generating an FMU but it is throwing up the same error again.
Is there any other model setting which influences this? Has anyone faced a similar issue?
All help and suggestions are appreciated.
댓글 수: 0
답변 (1개)
Himanshu
2024년 3월 21일
Hello Ashwin,
I understand that you have successfully compiled your model but you are encountering an error stating, "Unable to read some variables. Variable name lengths must be less than or equal to MATLAB's maximum name length of 63 characters," when attempting to convert it to an FMU.
I faced a similar issue and found a solution that worked for me in MATLAB R2022a. Typically, this problem arises when variable names exceed the maximum length of 63 characters, as discussed in a MATLAB Answers post here:
The real challenge was pinpointing and locating where the error was occurring. Reinstalling MATLAB R2022a fixed this error.
I hope this helps.
댓글 수: 2
Himanshu
2024년 3월 21일
Hello Ashwin,
Glad to know that your issue was resolved. Thank you for sharing the details of the issue.
참고 항목
카테고리
Help Center 및 File Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!