Embedded Coder

Defining and Controlling Custom Data

Embedded Coder enables you to define and control how the model data appears in the generated code. To facilitate software integration, you can specify class, size, and complexity of MATLAB data with the MATLAB Coder project user interface for entry point functions and global data.

For MATLAB code, Embedded Coder supports all MATLAB Coder data definitions including fixed-point objects.

For Simulink models, Embedded Coder supports the following data specification and data dictionary capabilities for generating code:

Simulink data object — Provides predefined storage classes, including constant, volatile, exported global, imported global, define directive, structure, bit field (including bit-packed structure), and get and set access methods

Module packaging data object — Provides preconfigured attributes for advanced data objects typically used in mass production, such as memory segments to calibrate or tune lookup tables

User data type — Lets you create abstract types for complex data so you can precisely control how model data appears in the generated code, interface with any legacy data, and augment or replace Simulink built-in types

The following tools help you design and manage project data in Simulink:

Custom Storage Class Designer — Lets you graphically create custom definitions and declarations to import data structures into the generated code, export data, conserve memory, or automatically generate data compliant with exchange standards, such as ASAM or ASAP2

Simulink Model Explorer — Displays all data used by Simulink models and Stateflow® charts and provides customizable views so you can tailor the information in a data dictionary format

Embedded Coder gives you access to ASAP2 data exchange files in Simulink, enabling you to export model data with complex data definitions using the ASAP2 standard. You can modify the built-in capabilities to produce other data exchange mechanisms.

A custom storage class created using the Customer Storage Class Designer.
A custom storage class created with the Customer Storage Class Designer, which lets you design, view, and validate complex data types using an intuitive graphical interface.
Next: Optimizing and Packaging Code

Try Embedded Coder

Get trial software

Best Practices for DO-178 Compliant Software using Model-Based Design

View webinar

Generate Optimized Code for Embedded Targets

Learn more