Main Content

Import Custom C/C++ Code Using the Simulink Code Importer

Create Simulink® libraries from your custom C/C++ code with the Simulink Code Importer tool

Use the Simulink Code Importer tool to build a Simulink library from your custom C/C++ code library. The Simulink Code Importer brings custom code into a Simulink library of C Caller blocks as callable functions, after analyzing the custom code for functions and their dependencies, including global variables and types used by the functions.

To use the Simulink Code Importer, go to the Modeling tab on the Simulink toolstrip. From Design, choose Code Importer. A series of screens then leads you through the process of creating a Simulink library from your custom code.

Alternatively, you can create an object of the Simulink.CodeImporter class and run the Simulink Code Importer tool using a command-line interface.

If you have a Simulink Test™ license, you can use the Simulink Code Importer to perform unit testing or integration testing on your custom C/C++ code. See Importing and Testing Custom C/C++ Code (Simulink Test).

Clases

Simulink.CodeImporterImport custom C/C++ code into Simulink
Simulink.CodeImporter.CustomCodeSpecify custom code settings for Simulink.CodeImporter and sltest.CodeImporter classes
Simulink.CodeImporter.OptionsSpecify additional import options for Simulink.CodeImporter and sltest.CodeImporter classes
Simulink.CodeImporter.ParseInfoInformation about parsed custom code
Simulink.CodeImporter.FunctionAccess and configure detailed information about parsed custom code functions
Simulink.CodeImporter.SimulinkPortSpecificationConfigure port specification for imported custom code

Bloques

C CallerIntegrate C code in Simulink

Temas