New configuration system and DAQ recording #165
christoph2
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So guys, this (v. 0.22) is a really comprehensive update... 🍾 🍾 🍾
The two most important changes are:
Configuration System
To get a first impression, run
xcp-profile create | less
Note
Using
xcp-profile
is not really required, every pyXCP based program/script can handle profiles.To write a configuration file, use option
-o
(-d
works the same way). Note: extension.py
is required in any case.It is recommended but not necessary to use
pyxcp_conf.py
as file name,because it is the file pyXCP looks for, if there is no
-c
option.Simply run
instead of
Upgrading an existing configuration
Convert a legacy configuration file as follows:
If there's no output option (
-d
or-o
), the result is written tostdout
.This means, the new configuration system now interprets the parameters
correctly.
For the sake of compatibility, nothing is changed when using old .JSON/.TOML files, but the IDs are crossed while converting your configuration files.
For the utterly confused, the logger dumps out some information on what's going on, e.g.:
Python as configuration language opens completely new posibilities, e.g.: a Python function instead of a .DLL can be used for seed-and-key unlocking:
Tested with Vector's XCPsim (CANape 20.0)
DAQ lists
First of all, there's an example run_daq demonstrating how-to DAQ -- Please read on before trying to run!
run_daq
was tested with CANape 20.0 and XCPlite;The CANape addresses may work, the XCPlite ones will certainly NOT!
DAQ measurements can be done in two ways:
.xmraw
file and then processed afterwards.This basic descision looks like this:
Note: DaqToCsv could be used as as startingpoint for own live processing.
If you look at the signature of the callback function
or a finished recording
you notice two timestamps,
timestamp0
andtimestamp1
.timestamp0
is created by pyXCP, whiletimestamp1
is the DAQ timestamp from your ECU or simulator (contained in the first ODT).Setup
There are basically only two data-structures the user has to care about:
A
DaqList
correspondeds to a XCP DAQ-list and looks conceptually like this:meas_name
is important when it comes to storage later on, it can be used for example as a name of a.csv
file, aSQL
table, aMDF
channel-group, and so on.event_num
the number of the event the DAQ-list is attached to, depending of the implementation, events may only used once.stim
is the direction of the DAQ-list (DAQ/STIM), and must beFalse
for now.enable_timestamps
timestamp-generation may enabled or disabled or may fixed, this is completely implementation-defined.measurements
is a list of tuples with the following content:name
in most cases the name of the A2L MEASUREMENT element.address
address_extension
datatype
datatype mnemonic, to get an overview run:python -c "from pyxcp.recorder import DATA_TYPES; print(DATA_TYPES)"
Note
16-bit floating-point variables are fully supported, but the availability is compiler-dependent;
F16
(5-bit exponent and a 11-bit mantissa),BF16
(8-bit exponent and a 8-bit mantissa, "brain-float")for details s. cppreference, and here
The allocation and optimization of ODTs is done automatically by pyXCP.
After a recording is done, you can now start processing; the basic pattern is as follows:
The are three examples for common use-cases (currently no Excel, sorry):
Miscellaneous / Minor changes
The build system is now poetry --
setup.py
is history!As an alternative to
python setup.py develop
one should usepip install -e .
Timestamping was somewhat chaotic (
time.time()
,time.perf_counter()
, ...) -- now handled by a C++ extension, timestamps are now UTC values (64-bit, with nano-seconds resolution). The startup timestamp (incl. timezone, UTC-offset, and DST-offset) is accessible:The type of the interface is currently not deduced, so the interface and the transport-layer configuration must match, e.g.:
Beta Was this translation helpful? Give feedback.
All reactions