Main Content

Configure AUTOSAR Internal Data Constraints Export

AUTOSAR applications use data constraints to implement limits on data types and provide a controlled range of possible values. Internal data constraints represent minimum and maximum values for implementation data types, reflecting the internal or machine view of the data.

By default, code generation does not export internal data constraint information for AUTOSAR implementation data types in ARXML code. If you want to force export of internal data constraints for implementation data types, select the XML option Internal DataConstraints Export.

If you select Internal DataConstraints Export, the exporter generates internal data constraints into an AUTOSAR package with a default name, DataConstrs, at a fixed location under the AUTOSAR data type package. Optionally, use the XML option Internal DataConstraints Package to specify a different AUTOSAR package name and path.

To configure export of AUTOSAR internal data constraint information in your model:

  1. Open the AUTOSAR Dictionary. On the AUTOSAR tab, select Code Interface > AUTOSAR Dictionary.

  2. Select XML Options. In the XML options view, under Additional Options, select Internal DataConstraints Export.

  3. Optionally, under Additional Packages, enter a package path for Internal DataConstraints Package.

  4. Build the model and inspect the generated code. Here is an example of an AUTOSAR internal data constraint exported to ARXML code.

            <DATA-CONSTR UUID="...">
                            <LOWER-LIMIT INTERVAL-TYPE="CLOSED">-128</LOWER-LIMIT>
                            <UPPER-LIMIT INTERVAL-TYPE="CLOSED">127</UPPER-LIMIT>

Alternatively, you can programmatically configure the AUTOSAR XML options Internal DataConstraints Export and Internal DataConstraints Package. For example:

arProps = autosar.api.getAUTOSARProperties(hModel);

For more information, see Configure AUTOSAR XML Options.

Related Examples

More About