Main Content

Call C Code Using C Caller Block

Call simple external C code into Simulink® by importing C functions

Use the C Caller block to integrate your C code into Simulink models. The C Caller block resolves source C code and extracts the functions to utilize in your Simulink models. To get started by configuring custom code sources in your Simulink model, see Specify and Configure Custom C/C++ Code.

The C Caller block does not support dynamic states and variables. To use dynamic states and variables in your custom block, see Implement C/C++ S-Functions.

Generating code using the C Caller block eliminates the need for writing Target Language Compiler (TLC) files.

Blocks

C CallerIntegrate C code in Simulink

Objects

FunctionPortSpecificationQuery and configure C Caller block properties (Since R2019b)

Topics