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

3 ビュー (過去 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 Center および File ExchangeSimulink Coder についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by