Generated Code Interfacing
Some applications must exchange data between generated code and external application code. Use the ASAP2 and CDF interface to establish a communication channel between development and target computers, export an ASAP2 file containing description format of the internal ECU variables, or export a Calibration Data Format (CDF) file containing the information about parameters in a machine-readable format. Use the C API to exchange data between generated code and external code.
To obtain metadata about the generated code, use the code descriptor programming interface.
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.
Tools
Generate Calibration Files | Generate ASAP2 and CDF files (Since R2021b) |
Classes
Functions
Topics
ASAP2 and CDF Interface
- 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. - Calibrate Generated Code and Monitor Signals
Generate XCP external mode target application and ASAP2 file that describes the XCP server configuration. - Generate ASAP2 and CDF Calibration Files
Generate ASAP2 and CDF files according to ASAM MCD-2 MC and ASAM AE CDF standards respectively. - Customize Generated ASAP2 File
Customize the ASAP2 file generated from a Simulink® model. - Create and Add Custom Data Elements
Add custom data elements to an ASAP2 file. - Customize Using Base Files
Use the base class and files to customize the ASAP2 fields Simulink model. - Configure Model Data Elements for ASAP2 File Generation
Set measurement and calibration properties for model data elements. - Frequently Asked Questions About ASAP2 File Generation
ASAP2 standard defines the description format of the internal electronic control unit (ECU) variables used in measurement and calibration and ASAM CDF standard defines the data for storing the ECU parameter values and the associated meta data.
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.