simulink-customize-a2l

Customize A2L calibration files exported from Simulink models using coder.asap2 APIs.

1.0k|98|Updated Apr 15, 2026
One-click install
npx skills add https://github.com/matlab/simulink-agentic-toolkit --skill simulink-customize-a2l
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: simulink-customize-a2l
Source: https://github.com/matlab/simulink-agentic-toolkit/tree/main/skills-catalog/code-generation/simulink-customize-a2l
Command: npx skills add https://github.com/matlab/simulink-agentic-toolkit --skill simulink-customize-a2l

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Customizing A2L (ASAP2) files generated from Simulink models is error-prone: the coder.asap2 and coder.mapping APIs have silent failure modes, counterintuitive coefficient directions, and undocumented type constraints that produce invalid calibration files rejected by tools like INCA and CANape.

Core Features & Use Cases

  • COMPU_METHOD Creation: Add LINEAR, RAT_FUNC, TAB_VERB, and IDENTICAL conversion methods with correct coefficient direction (PHYS-to-INT for RAT_FUNC).
  • Lookup Table and Axis Customization: Convert STD_AXIS to COM_AXIS with ForceShared, create CURVE/MAP/CUBOID characteristics with proper RecordLayout struct arrays.
  • Variant Coding and Grouping: Create VARIANT_CODING with VarCriterion and VarCharacteristic, organize elements into GROUPs, and add BIT_OPERATION to measurements.
  • Use Case: An engineer needs to export an A2L file where a temperature signal uses a custom RAT_FUNC conversion, breakpoints are shared across lookup tables, and certain inports are excluded. This Skill generates the correct getEcuDescriptions, add/set, and export calls while avoiding silent pitfalls like omitting CustomEcuDescriptions.

Quick Start

Ask the agent to add a RAT_FUNC COMPU_METHOD and convert a lookup table to COM_AXIS in the A2L file exported from your Simulink model.

Frequently Asked Questions about simulink-customize-a2l

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I customize an A2L file generated from a Simulink model?

Use coder.asap2.getEcuDescriptions to create an ECU description object, modify elements with add, set, or delete, then call coder.asap2.export with CustomEcuDescriptions set to the modified object. Omitting CustomEcuDescriptions silently discards all customizations.

How do I add a COMPU_METHOD to an A2L file in MATLAB?

Create a coder.asap2.CompuMethod object, set its ConversionType (LINEAR, RAT_FUNC, TAB_VERB, or IDENTICAL), coefficients, units, and format, then add it to the description object and reference it by name from a Measurement or Characteristic.

Why are my A2L customizations missing after export?

The most common cause is calling coder.asap2.export without passing CustomEcuDescriptions=descObj, which silently exports the default A2L. Another cause is skipping slbuild after setInport or setOutport changes, which produces stale output.

What MATLAB release do I need for A2L variant coding?

VarCriterion and VarCharacteristic require MATLAB R2025a or later. Groups need R2023b, RecordLayout and AxisInfo need R2023a, and basic COMPU_METHOD, Measurement, and Characteristic customization works from R2022b.

How do I convert STD_AXIS to COM_AXIS in an A2L file?

Set ForceShared to true on the Characteristic using set(descObj, 'Characteristic', name, 'ForceShared', true). This automatically creates AXIS_PTS objects and converts axis descriptors; do not manually create AxisInfo objects for this conversion.

When should I not use the coder.asap2 customization workflow?

Do not use it for reading or parsing existing A2L files (use Vehicle Network Toolbox a2lfile instead), configuring XCP/CAN transport layers, or general Embedded Coder build setups that involve no A2L customization.