This project helps you use the CANedge for XCP on CAN data acquisition:
- Load A2L file(s)
- Load user-defined text file (e.g.
CSV
) with ECU signal names and event channel numbers - Generate DAQ frames required for dynamic DAQ initialization (incl. FD support and optimized packaging)
- Generate CANedge transmit list for setting up dynamic DAQ
- Generate DBC file that enables decoding of the initialized DAQ list
- Load the JSON transmit list into an existing CANedge Configuration File
- Easily combine transmit lists across multiple ECUs
- Install Python 3.11+
- Install requirements incl. a2lparser via below:
pip install -i https://test.pypi.org/simple/ a2lparser --extra-index-url https://pypi.org/simple/
pip install jsonschema
- Prepare your A2L files for a single ECU (do not try to mix A2L files across ECUs)
- Add required A2L measurements in a text file (e.g.
CSV
) structured as below (headers will be ignored):
<signalname1>;<event channel index e.g. 1>
<signalname2>;<event channel index e.g. 1>
<signalname3>;<event channel index e.g. 2>
...
- Open your command prompt and run below:
python canedge_xcp.py path/to/ecu1.dbc path/to/ecu1.json path/to/ecu1.csv --a2l path/to/ecu1_part1.a2l path/to/ecu1_part2.a2l
The script will output the generated CANedge transmit list and DBC file. You can easily load the transmit list into an existing Configuration File locally (e.g. from an SD) with optional Rule Schema validation:
python update_existing_config.py path/to/ecu1.json path/to/config-01.09.json true --input_schema_file path/to/schema-01.09.json
Alternatively, you can load it via the CANedge Config Editor using the 'partial config loader' tool - or via the canedge-manager for OTA updates.
You can test the functionality via our sample files:
python canedge_xcp.py tests/output/ecu1.dbc tests/output/ecu1.json tests/measurement-files/sample.csv --a2l tests/a2l-files/ECU-sample-file.a2l
python update_existing_config.py tests/output/ecu1.json tests/config-schema-files/config-01.09.json true --input_schema_file tests/config-schema-files/schema-01.09.json
The same script functionality can easily be extended for use with multiple ECUs that leverage separate CAN IDs:
- Run the above process once for each ECU (with the relevant A2L and signal files)
- Use the
combine_multiple_ecus.py
script to combine the transmit list JSON files into a single list
See below an example set of commands:
python canedge_xcp.py path/to/ecu1.dbc path/to/ecu1.json path/to/ecu1.csv --a2l path/to/ecu1_part1.a2l path/to/ecu1_part2.a2l
python canedge_xcp.py path/to/ecu2.dbc path/to/ecu1.json path/to/ecu2.csv --a2l path/to/ecu2.a2l
python combine_multiple_ecus.py path/to/ecu1_and_ecu2.json --input_transmit_files path/to/ecu1.json path/to/ecu2.json --offset_delta -500
Notes:
- The script warns you if the CAN ID is the same across the JSON files (separate ECUs must use separate IDs)
- The script warns you if the joint transmit list exceeds the max number of frames or data bytes supported
- Optionally use
--offset_delta
to control the time spacing between distinct ECU DAQ initialization sequences
You can decode the DAQ-DTO data using the output DBC file(s) in below tools:
- asammdf GUI (v8.2.5d5+)
- MF4 decoders (e.g. for deploying Grafana dashboards)
- The script assumes you are using CANedge FW
01.09.01+
(support for longer transmit lists) - It can be useful to add multiple commands in a
*.bat
file for repeated use - This script is provided as-is and we do not take responsibility for any issues arising from its use