Main Content

readSingleValue

Read single sample of specified measurement from memory

Description

value = readSingleValue(xcpch,'measurementName') acquires a single value for the specified measurement through the configured XCP channel and stores it in a variable for later use. The values are read directly from memory.

example

Examples

collapse all

Read a single value from a '100ms' event 'Triangle' measurement.

Create an object to parse an A2L file and connect that to an XCP channel.

a2lfile = xcpA2L('XCPSIM.a2l')
xcpch = xcpChannel(a2lfile,'CAN','Vector','Virtual 1',1);

Connect the channel to the server module.

connect(xcpch)

Acquire data for the 'Triangle' measurement.

value = readSingleValue(xcpch,'Triangle')
value =

    14

Input Arguments

collapse all

XCP channel, specified as an XCP channel object created using xcpChannel. The XCP channel object can then communicate with the specified server module defined by the A2L file.

Name of a single XCP measurement specified as a character vector or string. Make sure measurementName matches the corresponding measurement name defined in your A2L file.

Data Types: char | string

Output Arguments

collapse all

Value of the selected measurement, returned as a numeric value.

Version History

Introduced in R2013a