Simulink s-function multiple instance compilation issue

조회 수: 6 (최근 30일)
Jiasheng wang
Jiasheng wang 2023년 12월 7일
댓글: Jiasheng wang 2024년 3월 7일
Hello!
I have a third-party generated s-function that I use in my model. This s-function is used multiple times.
And when I compile my models, if this s-function is referenced twice, then everything is fine, I manage to build the .exe file.
However, if I use it three times, then an error is thrown during the build, and error message is just 'internal compiler error'.
Do you have any idea what is the problem? Anything to do with the thread safety?

답변 (1개)

Venkat Siddarth Reddy
Venkat Siddarth Reddy 2023년 12월 27일
I understand that you are using third party generated S-Function in your Simulink model and it throws "internal compiler error" when the S-function is referenced for more than twice.
Without the Simulink model and the S-function, it is difficult to diagnose the exact cause of this issue.
However from the context, it seems like a thread safety issue, where an internal state is being maintained across different S-function calls, which may not be thread safe.
To troubleshoot the issue:
  • Consider reaching out to the author of S-Function for support, especially if it's a proprietary or commercial product.
  • If you have the S-Function code, please review it for thread-safety and make the necessary changes accordingly.
I hope this helps!
  댓글 수: 1
Jiasheng wang
Jiasheng wang 2024년 3월 7일
Hi! Thanks for the answer. This s-function is not hand-written. It is generated by simulink coder. As far as I understand there shouldn't be thread safety issue(I can also see Dwork vector is used).
Anyway this s-function is generated from a complex model so quite difficult to debug and modify..

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

카테고리

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

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by