Callable Function Integration
An Embedded Coder® deployment option is to generate source code modules that are intended for integration with a platform-specific function scheduler and other platform middleware. To integrate the code, account for data considerations such as:
Importing parameter data that has conditionally compiled dimensions.
Exchanging structured or enumerated data between generated and external code.
Replacing or renaming data types to conform to coding standards.
Another option is to generate shared libraries that you can integrate into an external code base.
Topics
Source Code
- Generate Component Source Code for Export to External Code Base
Integrate C/C++ source code, which you generate from a model component, with code developed outside the Simulink® environment. - Generate Code That Matches Appearance of External Code
Configure how the code generator applies identifiers (symbols), comments, code styles, code format, and organization. - Integrate External Application Code with Code Generated from PID Controller
Generate code that matches the data interfaces, appearance, and organization of external code. - Generate Main Program for Deployment to Bare-Metal Target Hardware
Configure model for producing an example main program. - Deploy Generated Component Software to Application Target Platforms
Run an executable program with a target support package for Linux®, Microsoft® Windows®, or Wind River® VxWorks® operating systems. - Deploy Applications to Target Hardware
Generate application code that includes an example main program and scheduler.
Shared Libraries
- Generate Shared Library for Export to External Code Base
Build a shared library from a model component and export the library to an application for system simulation, software reuse, or intellectual property protection. Requires an Embedded Coder license. - Interface to a Development Computer Simulator by Using a Shared Library
Generate a shared library that you can load dynamically into another application. - Use S-Function Target for Model or Subsystem
Use a shared library generated from a model or subsystem that you can load dynamically into another application.
Data Considerations
- Access Structured Data Through a Pointer That External Code Defines
Generate code that accesses parameter data through a structure pointer that handwritten code defines. - Import Parameter Data with Conditionally Compiled Dimension Length
Generate code that imports an array parameter whose dimension lengths your external code sets with macros (#define
). - Reuse Parameter Data from External Code in the Generated Code
Generate code that imports parameter data from your external code. - Exchange Structured and Enumerated Data Between Generated and External Code
Generate code that you can compile together with existing, external code. The bodies of code exchange structured and enumerated data. - Exchange Data Between External C/C++ Code and Simulink Model or Generated Code
Configure the signals, states, and parameters in a Simulink model to match the data interface of your existing C code. - Exchange Data Between External Calling Code and Generated Code
When you export the generated code into your external code, exchange signal, state, and parameter data. - Replace and Rename Simulink Coder Data Types to Conform to Coding Standards
Conform to the coding standards of your organization by replacing and renaming the Simulink Coder™ data type aliases, such asreal_T
, which the generated code uses to define data.
C++ Support
- Generate C++ Class Interface to Model or Subsystem Code
Generate a C++ class interface to code generated from a model or subsystem. - Generate Code for String Blocks by Using the Standard C++ String Library
Generate C++ code for Simulink string blocks.