Logo Simulink Customize A2l

Simulink Customize A2l

Tổ chứcPhổ biến
matlab
simulink-customize-a2l

Tùy chỉnh tệp A2L (ASAP2) được tạo từ mô hình Simulink bằng các API coder.asap2 và coder.mapping. Dùng kỹ năng này khi thêm COMPU_METHOD, tạo GROUP, chuyển STD_AXIS thành COM_AXIS, thêm BIT_OPERATION, tạo VARIANT_CODING, loại trừ các phép đo hoặc phần tử struct, xóa DEFAULT_EVENT_LIST hoặc tùy chỉnh A2L để tương thích với công cụ hiệu chuẩn (INCA, CANape). Cũng dùng khi người dùng nhắc đến ASAP2, dữ liệu hiệu chuẩn ECU hoặc xuất A2L.

Add to TypingMind

Tổng quan

Nhà phát hànhmatlab
Kho mãsimulink-agentic-toolkit
Tên kỹ năngsimulink-customize-a2l
Sao
1.2K
Bản fork
112
Tệp đi kèm
6
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 6 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được matlab công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Simulink Customize A2l trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/matlab/simulink-agentic-toolkit/tree/main/skills-catalog/code-generation/simulink-customize-a2l
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/matlab/simulink-agentic-toolkit.git /tmp/simulink-agentic-toolkit
mkdir -p .claude/skills
cp -r /tmp/simulink-agentic-toolkit/skills-catalog/code-generation/simulink-customize-a2l .claude/skills/simulink-customize-a2l
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Simulink Customize A2l trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Simulink Customize A2l ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Simulink Customize A2l với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Customize A2L Files

Customize A2L (ASAP2) files generated from Simulink models using the coder.asap2 and coder.mapping APIs, avoiding silent errors and undocumented pitfalls.

When to Use

  • Adding or modifying COMPU_METHODs (LINEAR, RAT_FUNC, TAB_VERB, IDENTICAL)
  • Creating or modifying GROUPs in the A2L file
  • Converting STD_AXIS to COM_AXIS for lookup tables
  • Adding BIT_OPERATION (LEFT_SHIFT, RIGHT_SHIFT, SIGN_EXTEND) to measurements
  • Creating VARIANT_CODING (VarCriterion, VarCharacteristic)
  • Excluding inports, outports, or struct elements from the A2L
  • Removing DEFAULT_EVENT_LIST or other IF_DATA blocks
  • Any customization passed via CustomEcuDescriptions to coder.asap2.export

When NOT to Use

  • Reading or parsing existing A2L files (use Vehicle Network Toolbox a2lfile)
  • Configuring XCP/CAN transport layers
  • Setting up Simulink model code generation (storage classes, data dictionaries)
  • General Embedded Coder build workflows without A2L customization

Core Workflow

Decision: Direct export vs. customization workflow

  • No element customization needed (only configuration like excluding struct elements or DEFAULT_EVENT_LIST): call coder.asap2.export directly with name-value options. No getEcuDescriptions needed.
  • Element customization needed (adding/modifying/deleting measurements, characteristics, groups, etc.): use the full getEcuDescriptions → customize → export workflow.
matlab
% === Path A: Config-only (no element changes) ===
load_system(modelName);
slbuild(modelName);
coder.asap2.export(modelName, SupportStructureElements=false, IncludeDefaultEventList=false);

% === Path B: Element customization ===
load_system(modelName);
slbuild(modelName);

% 1. Create ECU descriptions — pass ALL configuration options here
descObj = coder.asap2.getEcuDescriptions(modelName, ...
    SupportStructureElements=false, ...
    IncludeDefaultEventList=false);

% 2. Customize elements
add(descObj, newElement);
set(descObj, 'ElementType', 'Name', Prop=value);
info = get(descObj, 'ElementType', 'Name');
names = find(descObj, 'ElementType');
delete(descObj, 'ElementType', 'Name');

% 3. Export — MUST pass descObj back or all customizations are silently lost
coder.asap2.export(modelName, CustomEcuDescriptions=descObj);

Critical: When using Path B, omitting CustomEcuDescriptions=descObj in the export call silently discards all customizations with no error.

Critical: When using Path B, construction-time options (SupportStructureElements, etc.) CANNOT be passed to export alongside CustomEcuDescriptions — they must be passed to getEcuDescriptions.

Key Functions

FunctionPurpose
coder.asap2.getEcuDescriptionsCreate ECU description object (construction-time config)
coder.asap2.exportExport A2L file with customizations
coder.asap2.CompuMethodCreate computation method
coder.asap2.CharacteristicCreate characteristic (parameter)
coder.asap2.MeasurementCreate measurement (signal)
coder.asap2.GroupCreate A2L group
coder.asap2.RecordLayoutCreate record layout
coder.asap2.AxisInfoCreate axis points or axis descriptor
coder.asap2.VarCriterionCreate variant criterion
coder.asap2.VarCharacteristicCreate variant characteristic
coder.asap2.FunctionCreate FUNCTION object for grouping measurements/characteristics
coder.mapping.api.getGet code mapping object (persistent settings)
setInport / setOutportControl inport/outport A2L export (persistent)

See references/object-properties.md for mandatory fields, valid types, and creation order for each coder.asap2.* class.

Pattern Routing

Match the user's task to the correct reference for detailed guidance:

TaskKey RuleReference
Add COMPU_METHOD (RAT_FUNC, LINEAR, TAB_VERB)RAT_FUNC COEFFS direction is PHYS→INT — invert the desired formulareferences/compu-method-guidance.md
Convert STD_AXIS to COM_AXIS (shared breakpoints)Use ForceShared=true on the Characteristic — do NOT manually create AXIS_PTSreferences/customization-patterns.md
Add BIT_OPERATION to a measurementMust set BOTH BitMask AND MaskData — either alone produces no outputreferences/customization-patterns.md
Exclude inports/outports persistentlyUse coder.mapping.api + setInport/setOutport + slbuildreferences/customization-patterns.md
Create VARIANT_CODINGMust create supporting CHARACTERISTIC objects (selection + variant-dependent) with RecordLayouts and CompuMethods BEFORE VarCriterion/VarCharacteristic. All multi-value properties must be string arrays (not char/cell).references/variant-coding-guidance.md
Create Characteristic (CURVE, MAP, CUBOID)RecordLayout struct array must match axis count for STD_AXIS typesreferences/object-properties.md
Create MeasurementSet DataType='SWORD', EcuAddress='@ECU_Address@name@', CompuMethodName='NO_COMPU_METHOD' as defaultsreferences/object-properties.md
Create GroupSee mandatory fields and ROOT constraintreferences/object-properties.md
Create RecordLayoutStruct array required for multi-axis types (MAP, CUBOID); single struct for VALUE/VAL_BLKreferences/object-properties.md
Create AxisInfo / AXIS_PTSDual role: add(descObj, axisInfo) creates AXIS_PTS; characteristic.AxisInfo = [...] creates AXIS_DESCRreferences/object-properties.md
Control construction-time options (SupportStructureElements, IncludeDefaultEventList, etc.)Must pass at getEcuDescriptions() — cannot set after construction or pass to export with CustomEcuDescriptionsreferences/construction-time-properties.md

Release Requirements

FeatureMinimum Release
COMPU_METHOD, Measurement, Characteristic, BIT_OPERATIONR2022b
RecordLayout, AxisInfo (STD_AXIS, CUBOID)R2023a
Group (ROOT groups)R2023b
VarCriterion, VarCharacteristic (variant coding)R2025a

If the user's release is too old, inform them. Do not attempt workarounds — the APIs do not exist on older releases.

Common Mistakes

These cause silent failures or incorrect calibration data. Always check before generating code:

MistakeWhy It's WrongCorrect Approach
coder.asap2.export(modelName) without CustomEcuDescriptions=descObjSilently discards all customizations — no error, exports default A2LAlways pass descObj back when using the customization workflow
RAT_FUNC Coefficients = [0 0.5 -40 0 0 1] for "PHYS = 0.5×INT - 40"COEFFS is PHYS→INT, not INT→PHYS — produces the inverse conversionInvert: INT = 2×PHYS + 80 → [0 2 80 0 0 1]. See references/compu-method-guidance.md
set(descObj, ..., 'CompuMethodName', name) before adding the CompuMethodset() auto-creates a placeholder that blocks subsequent add()delete() the auto-created placeholder, then add() the user's version
MaskData.Shift without BitMaskBIT_OPERATION block is only emitted when both are setAlways set BitMask (e.g., '0xFF') alongside MaskData
MaskData.Shift = 3 expecting LEFT_SHIFTPositive = RIGHT_SHIFT; sign is counterintuitiveUse -3 for LEFT_SHIFT 3
Manually creating AXIS_PTS for STD→COM_AXISUnnecessary complexity; error-prone struct array handlingUse set(descObj, 'Characteristic', name, 'ForceShared', true)
descObj.SupportStructureElements = falseNot a settable property after constructionPass at creation: getEcuDescriptions(mdl, SupportStructureElements=false)
VarAddress = '0x5000' (char vector)Char vector silently produces empty output — no addresses, no criterion nameMust be string array: ["0x5000","0x5008"]
CompuVTabValues.Integers = [0,1,2]Property does not existUse CompuVTabValues.Values = [0, 1, 2]
CompuVTabValues.Literals = {'A','B'} (cell array)Accepted without error but exports 0 elementsMust be string array: ["A","B"]
Skipping slbuild after setInport/setOutportExport silently produces stale A2L with old settingsAlways slbuild after code mapping changes before export
Hardcoding EcuAddress = '0x0000'Calibration tools cannot resolve the address at import timeUse '@ECU_Address@<elementName>@' for linker resolution
Leaving mandatory fields unset on new objectsBlank fields produce invalid A2L — calibration tools reject the fileSee references/object-properties.md for required fields per class
Creating VarCriterion/VarCharacteristic without supporting CHARACTERISTICsVARIANT_CODING references characteristics that don't exist — calibration tool rejects the fileCreate selection CHARACTERISTIC (with TAB_VERB CompuMethod) and variant-dependent CHARACTERISTIC (with RecordLayout) BEFORE VarCriterion/VarCharacteristic. See references/variant-coding-guidance.md

Conventions

  • Verify A2L output with fileread after export — use contains for additions, ~contains for deletions/exclusions
  • Use string arrays (not char vectors or cell arrays) for all multi-value properties
  • Pass all configuration at getEcuDescriptions() construction time
  • Use ForceShared=true for STD→COM_AXIS (never build AXIS_PTS manually for this)
  • Use delete(descObj, 'ElementType', 'Name') to remove auto-created placeholders — this is the only recovery from the auto-creation trap caused by set() on a reference name before the referenced object exists
  • Prefer coder.mapping.api over coder.asap2 when settings should persist with the model

Copyright 2026 The MathWorks, Inc.


Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Simulink Customize A2l làm được gì?

Tùy chỉnh tệp A2L (ASAP2) được tạo từ mô hình Simulink bằng các API coder.asap2 và coder.mapping. Dùng kỹ năng này khi thêm COMPU_METHOD, tạo GROUP, chuyển STD_AXIS thành COM_AXIS, thêm BIT_OPERATION, tạo VARIANT_CODING, loại trừ các phép đo hoặc phần tử struct, xóa DEFAULT_EVENT_LIST hoặc tùy chỉnh A2L để tương thích với công cụ hiệu chuẩn (INCA, CANape). Cũng dùng khi người dùng nhắc đến ASAP2, dữ liệu hiệu chuẩn ECU hoặc xuất A2L.

Vì sao nên dùng Simulink Customize A2l trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Simulink Customize A2l là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Simulink Customize A2l trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/matlab/simulink-agentic-toolkit/tree/main/skills-catalog/code-generation/simulink-customize-a2l. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Simulink Customize A2l?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Simulink Customize A2l với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Simulink Customize A2l với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Simulink Customize A2l có miễn phí không?

Kỹ năng này được matlab phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇