Export Model as FMU with Linux Binary on Windows

조회 수: 12 (최근 30일)
wen li
wen li 2024년 6월 29일
댓글: wen li 2024년 7월 4일
Hello Mathwork team:
I would like to export FMU according this documnent(Export Model as FMU with Linux Binary on Windows - MATLAB & Simulink - MathWorks China) .
but after I try generate FMU model, a error happened. it tell me “Failed to setup the environment. WSL must be at least version '2.0.9.0'. ”. Then I have check my WSL verison. it shows my WSL version is 2.2.4.0. and I have run WSL --update and try to update the version of WSL, but it tell me my WSL version is the latest one.
so I think my WSL is the latest one, but why simulink still reminde me that my WSL version is not ok? can you help me to solve it.
matlab verstion: 2024a update 4
FMU builder version: 24.1.1
thank you
  댓글 수: 2
Umar
Umar 2024년 6월 30일
Hi Wen li,
To address the issue with the WSL version error in MATLAB when exporting an FMU model, ensure that the WSL version is correctly recognized by MATLAB. Sometimes, even though the WSL version is up to date, MATLAB may not detect it accurately.
One workaround is to manually set the WSL version in MATLAB by modifying the system environment variables. You can try setting the WSL version to '2.0.9.0' explicitly in the system settings to see if MATLAB recognizes it correctly.
Hope that answers your question.
wen li
wen li 2024년 7월 1일
Hello, Umar:
thank you for your answer. but I don't know how to change the system setting. Can you tell me how to do it.
thank you.

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

채택된 답변

Umar
Umar 2024년 7월 1일
Hi Wen li,
This one is a little tough to tackle, sounds like IT Engineer job. However, if I jog my memory, you have to manually set the WSL version in MATLAB by following these steps: first, try Open the System Properties window by pressing Windows key + Pause/Break. Then, click on "Advanced system settings" on the left.Afterwards, in the System Properties window, go to the "Advanced" tab and click on "Environment Variables". Under System Variables, click on "New" and add a new variable: Variable name: WSLENV Variable value: MATLAB_VER=2.0.9.0
Then, click "OK" to save the changes and restart MATLAB to apply the new WSL version setting.
By explicitly setting the WSL version to '2.0.9.0' in the system settings, you can help MATLAB recognize the correct WSL version and resolve the export issue with FMU models.
Let me know if you need my further assistance. Good luck!
  댓글 수: 1
wen li
wen li 2024년 7월 3일
Hello, Umar:
I have follow your advise, it is still not work. but then I have change my system language to English.(Default is Chinese). then matlab can recognize WSL.
but when I try to generate FMU, another issue is happened.
Setting System Target to FMU 'Co-Simulation' for model 'TestDemo'. Setting Hardware Implementation > Device Type to 'MATLAB Host' for model 'TestDemo'. ### 'GenerateComments' is disabled for 'Co-Simulation' FMU Export. Build Summary Top model targets built: Model Action Rebuild Reason ========================================================================================== TestDemo Code generated and compiled. Code generation information file does not exist. 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 15.925s
Assertion failed.
do you know the root cause?
thank you

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

추가 답변 (1개)

Umar
Umar 2024년 7월 3일
Hi Wen,
Analyzing your error message, the assertion failure typically occurs when a condition that should be true at a particular point in the code is false. In this case, the assertion failure might be due to a discrepancy or inconsistency in the code or the settings related to FMU generation.
  댓글 수: 1
wen li
wen li 2024년 7월 4일
Hello, Umar:
thank you for your quick answer.
I am shortening the file path, then it passed.
all issue is solved, now I can generate FMU with Linux binary.
thank you

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

카테고리

Help CenterFile Exchange에서 Create Standalone FMU에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by