"Unable to read some Variables" error when converting to FMU
14 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Himanshu
on 21 Mar 2024
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 Comments
Himanshu
on 21 Mar 2024
Hello Ashwin,
Glad to know that your issue was resolved. Thank you for sharing the details of the issue.
See Also
Categories
Find more on Programmatic Model Editing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!