How to use C Caller block with C code having multiple functions ?

I want to use a C language code into simulink which has multiple functions in it. Can it be done by C Caller block.

 채택된 답변

Mark McBroom
Mark McBroom 2021년 9월 14일

0 개 추천

The C Caller block can only call one function. You can either use a seperate C-Caller block for each function, or write a wrapper C-function that calls multiple functions and then call that wrapper C-function from the C-Caller block.

댓글 수: 5

Can you explain this in detail, how to call that wrapper c cfunction in c caller?
I have only 1 c file, but 2 functions inside that, so can I use one c caller block to implement 2 c functions at a time? If yes, can you explain how
The C Caller block can only call one function. You could use two C caller blocks, one for each function, and then place the 2 C Caller blocks inside a subsystem ... or you can use the C Function block and call both C functions from the single C Function block.
Okay , thank you for clarifying my doubt. whether s function block can call 2 functions inside one block?

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

추가 답변 (0개)

제품

릴리스

R2021a

질문:

2021년 8월 30일

댓글:

2024년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by