Main Content

writeAxis

Scale and write specified axis value to direct memory

Description

example

writeAxis(chanObj,axis,value) scales and writes a value for the specified axis through the XCP channel object chanObj. This action performs a direct write to memory on the server module.

Examples

collapse all

Write a value to an XCP axis and verify the value.

Read the original value.

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

Write a new value.

newValue = 50;
writeAxis(chanObj,axisObj,newValue);

Read the value again to verify.

readAxis(chanObj,axisObj)
     50

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

Value for axis write, specified as type supported by the axis.

Version History

Introduced in R2018a