Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

readSingleValue

Read single sample of specified measurement from memory

Syntax

value = readSingleValue(xcpch,'measurementName')

Description

example

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.

Examples

collapse all

Read a single value from a '100ms' events '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 slave 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 slave 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.

Introduced in R2013a

Was this topic helpful?