Main Content

readMeasurement

Read and scale specified measurement value from direct memory

Description

example

value = readMeasurement(chanObj,measurement) reads and scales a value for the specified measurement 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 measurement, identifying the measurement by name.

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

Alternatively, create a measurement object and read its value.

measObj = a2lObj.MeasurementInfo('limit');
value = readMeasurement(chanObj,measObj)
     100

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: 'limit'

Data Types: char

Output Arguments

collapse all

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

Version History

Introduced in R2018a