Main Content
Read a Calibrated Measurement
This example shows a typical workflow for reading a calibration file and using a translation table to calibrate a measurement reading.
Read the engine management ECU calibration file.
a2lobj = xcpA2L('ems.a2l');
Connect to the ECU.
ch = xcpChannel(a2lobj,'UDP','192.168.1.55',5555);
Set the table that translates a pedal position to a torque demand.
writeCharacteric(ch,'tq_accel_request', ... [0 2 4 9 14 24 48 72 96 144 192 204 216 228 240]);
Set the pedal position to 50%.
writeMeasurement(ch,'pedal_position',50);
Read the demand.
value = readMeasurement(ch,'tq_demand')
value = 96