Main Content

readAxis

Read and scale specified axis value from direct memory

Description

example

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

Examples

collapse all

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

a2lObj = xcpA2L('myA2Lfile.a2l');
chanObj = xcpChannel(a2lObj,'CAN','Vector','Virtual 1',1);
connect(chanObj);
value = readAxis(chanObj,'pedal_position');

Alternatively, create an axis object and read its value.

axisObj = a2lObj.AxisXs('pedal_position');
value = readAxis(chanObj,axisObj);

Input Arguments

collapse all

XCP channel, specified as an XCP channel object.

Example: xcpChannel()

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

Example: 'pedal_position'

Data Types: char

Output Arguments

collapse all

Value from axis read, returned as type supported by the axis.

Version History

Introduced in R2018a