writeMeasurement

Scale and write specified measurement value to direct memory

Description

example

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

Examples

collapse all

Write a value to an XCP measurement, and verify the value.

Read original value.

a2lObj = xcpA2L('myA2Lfile.a2l');
chanObj = xcpChannel(a2lObj,'CAN','Vector','Virtual 1',1);
connect(chanObj);
measObj = a2lObj.MeasurementInfo('limit');
value = readMeasurement(chanObj,measObj)
     100

Write a new value.

newValue = 120;
writeMeasurement(chanObj,measObj,newValue);

Read the value again to verify the change.

readMeasurement(chanObj,measObj)
     120

Input Arguments

collapse all

XCP channel, specified as an XCP channel object.

Example: xcpChannel()

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

Example: 'curve1_8_uc'

Data Types: char

Value for measurement write, specified as a data type supported by the measurement.

Introduced in R2018a