MATLAB Embedded Coder C-Caller Block: Custom type function variable arguments

조회 수: 5 (최근 30일)
Clemens K
Clemens K 2021년 11월 2일
답변: Roy Mathew 2021년 11월 30일
Hello,
i want to use my C-Code in MATLAB Embedded Coder. I currently use the C-Caller Block to integrate my C-Code respective my C-functions. The problem is that I use custom data types for function arguments and the "Block Parameters: C Caller" does not recognise my function. When I change the function argument in my C-Code to e.g. int the C-Caller Block immediately shows up the function. How to avoid that issue?
Thank you and kind regards
Clemens

답변 (1개)

Roy Mathew
Roy Mathew 2021년 11월 30일
C Caller directly calls the function from Simulink. So, the inputs to the function must be simulink compatible. If any of the inputs of the C Function cannot be mapped to a simulink supported type, then the function will not show up.
Alternatively, you can use the C Function block, which allows you freedom in calling functions that are directly unsupported in Simulink.
https://www.mathworks.com/help/simulink/ug/call-and-integrate-external-c-algorithms-into-simulink-using-c-function-blocks.html

카테고리

Help CenterFile Exchange에서 Naming Conventions에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by