Interface large C project by simulink

1 visualización (últimos 30 días)
Thomas Müller
Thomas Müller el 26 de Jun. de 2017
Respondida: Dhruvesh Patel el 29 de Jun. de 2017
I have a large C project with many functions and dependencies. I want to access some of the functions from Simulink to use the functionality of the C project in Simulink. Is this possible or might I run into problems for large C projects? What is the best way of wrapping the functionality out of a large C project to Simulink?

Respuestas (1)

Dhruvesh Patel
Dhruvesh Patel el 29 de Jun. de 2017
Simulink provides C-Mex S-Functions to bring in legacy C code into Simulink. There are several several ways to create S-Functions from existing C code. You should pick one based on the size of the project, the amount of control you require over the interaction between Simulink engine and the C Code, code generation requirements, etc,. Following are the ways in which you could create an S-Function from C code, listed in descending order of the amount of control they provide while creating the S-Function.
  1. Writing S-Function manually
  2. S-Function builder block
  3. Legacy Code Tool
You could also use MATLAB Function Block to call C Code into Simulink. Since your project is large, this would not be a recommended way.

Categorías

Más información sobre Simulink Coder en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by