Main Content


Read and scale specified characteristic value from direct memory



value = readCharacteristic(chanObj,characteristic) reads and scales a value for the specified characteristic through the XCP channel object chanObj. This action performs a direct read from memory on the server module.


collapse all

Read the value from an XCP channel characteristic, identifying the characteristic by name.

a2lObj = xcpA2L('myA2Lfile.a2l');
chanObj = xcpChannel(a2lObj,'CAN','Vector','Virtual 1',1);
value = readCharacteristic(chanObj,'torque_demand');

Alternatively, create a characteristic object and read its value.

charObj = a2lObj.CharacteristicInfo('torque_demand');
value = readCharacteristic(chanObj,charObj);

Input Arguments

collapse all

XCP channel, specified as an XCP channel object.

Example: xcpChannel()

XCP channel characteristic, specified as a character vector or characteristic object.

Example: 'torque_demand'

Data Types: char

Output Arguments

collapse all

Value from characteristic read, returned as a type supported by the characteristic.

Version History

Introduced in R2018a