Code Generation Error with S-Function

조회 수: 38 (최근 30일)
Serhat Sarihan
Serhat Sarihan 2024년 12월 5일 12:51
댓글: Serhat Sarihan 2024년 12월 6일 11:46
I have a simple model
with a simple S-function project that does multiplication.
When I try to generate code from this model with the following build command
clear, clc
rtwbuild('Test_Model')
I get loads of errors as follows;
Somehow, I think, it has to do with custom code part of model configuration which I could not fix.
Without changing the S-Function project, I would like to be able to generate code successfully.

채택된 답변

Githin George
Githin George 2024년 12월 6일 5:42
편집: Githin George 2024년 12월 6일 5:47
Hi Serhat,
You might have missed adding your dependencies (multiplier.cpp) to your S-Function in the block parameters. This usually helps Simulink figure out all the CPP files required to do the code generation and avoid any potential linker errors. In my case "multiply_sfunction" is my S-Function and it depends on the CPP file "multiply.cpp"
See the Image below:
From the images I am assuming you are using CPP files instead of tlc to define your S-Function in which case this should work fine.
Refer to the documentation below:
  댓글 수: 1
Serhat Sarihan
Serhat Sarihan 2024년 12월 6일 11:46
Hello Githin,
This solved my problem. Thank you very much for your help.

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by