Generated Code Interfacing
Some applications must exchange data between generated code and external application code. Use the MATLAB code descriptor API to obtain the metadata about the generated code. Use the C API to interface with the generated code at runtime and to monitor and tune model elements during the execution of model code on the target platform.
Sample Target Environment Service Implementations of Data Communication Methods shows samples of how target environment services might implement the three types of data communication methods: direct access, outside execution, and during execution.
Classes
Functions
Topics
Configure Data Types in Generated Code
- Parameter Data Types in the Generated Code
Optimize the generated code and generate code for specific processors by controlling the data types that store parameter data in computer memory. - Create Tunable Calibration Parameter in the Generated Code
In the generated code, create tunable parameter data that you can access during rapid prototyping and calibration.
C API Interface
- Get Started with C API
Learn the principles of using C API to interact with the generated model code.
- Configure Model to Generate C API Code
Learn how to configure your model to include different types of C API elements in the generated code.
- Write External Code to Access Generated C API Code
Learn how to write external code that can access generated C API code elements.
- Use C API to Monitor and Tune Generated Model Code
Learn the details about how to use the C API to monitor and tune model elements.
- STEP 1: Explore Measurable and Tunable Model Elements
- STEP 2: Configure Model to Add C API Signals in Code Generation
- STEP 3: Write Code to Interact with Generated C API Signal Code
- STEP 4: Interact with C API Signal Code Throughout Execution
- STEP 5: Write Code to Interact with Generated C API Signal and Parameter Code
- STEP 6: Use Custom Monitor to Measure and Tune Model Elements in Real Time
Code Descriptor Interface
- Get Code Description of Generated Code
Obtain metadata about the generated code. - Get Generated Type and Name of Inport Structures
Obtain metadata about the inport structures in generated code. - Get Metadata About Service Interface
Obtain metadata about the generated service interface by using the code descriptor programming interface. - Get Metadata About Test Points and Logged Signals in Generated Code
Retrieve metadata for test points and logged signals in generated code.