Real-Time Workshop Embedded Coder | ![]() ![]() |
Defining ASAP2 Information
The ASAP2 file generation process requires information about your model's parameters and signals. Some of this information is contained in the model itself. The rest must be supplied by using Simulink data objects with the necessary properties.
Real-Time Workshop provides two example data classes to assist you in providing the necessary information. The classes are
This document refers to these as the ASAP2 classes, and to objects instantiated from these classes as ASAP2 objects. The ASAP2 class creation files are located in the directory matlabroot
/toolbox/rtw/targets/asap2/asap2
. To create ASAP2 objects, make sure that this directory is on the MATLAB path.
As with the built-in Simulink.Parameter
and Simulink.Signal
classes, we recommend that you create your own packages and classes rather than using the ASAP2 classes directly. To do this, copy and rename the directory matlabroot
/toolbox/rtw/targets/asap2/asap2/
@ASAP2
, and modify the class creation files it contains. You can extend the ASAP2 classes if additional properties are required. For general information about extending data object classes, see "Working with Data Objects" in the Using Simulink documentation.
The following table contains the minimum set of data attributes required for ASAP2 file generation. Some data attributes are defined in the model; others are supplied in the properties of ASAP2 objects. For attributes that are defined in ASAP2.Parameter
or ASAP2.Signal
objects, the table gives the associated property name.
Data Attribute |
Defined In |
Property Name |
Data type |
Model |
Not applicable |
Scaling (if fixed point data type) |
Model |
Not applicable |
Name (Symbol) |
Data object |
Inherited from name of handle to the data object to which parameter or signal name resolves |
Long identifier (Description) |
Data object |
LongID_ASAP2 |
Minimum allowable value |
Data object |
PhysicalMin_ASAP2 |
Maximum allowable value |
Data object |
PhysicalMax_ASAP2 |
Units |
Data object |
Units_ASAP2 |
Memory Address (optional) |
Data object (see note below) |
MemoryAddress_ASAP2 (optional; see Memory Address Attribute below) |
Memory Address Attribute. The Memory Address attribute, if known before code generation, can be defined in the data object. Otherwise, a placeholder string is inserted. You can replace the placeholder with the actual address by post-processing the generated file. See the file matlabroot/toolbox/rtw/targets/asap2/asap2/asap2post.m
for an example.
![]() | Targets Supporting ASAP2 | Generating an ASAP2 File | ![]() |