Main Content

Communication in MATLAB

Use an A2L file to allow communication between XCP client and server modules via XCP

一个A2L def文件是一种特殊的描述文件ines the implementation of an ECU. The information in an A2L file allows an XCP client to communicate with a server module via an XCP connection. The formatted text file contains event and measurement definitions, and other configuration information, used for acquiring and stimulating data and to perform other functions.

To communicate with an XCP server over CAN, an A2L file (ECU description file) must contain at least the following property information:

  • ProtocolLayerInfo

  • TransportLayerCANInfo

  • Measurements

  • DAQInfoandEvents

    • MATLAB®:DAQInfoandEventscontent is required if using dynamic DAQ list functionality.

    • 金宝app®: Because theXCP CAN Data Acquisitionblock uses dynamic DAQ list functionality,DAQInfoandEventscontent is required.

You can connect your XCP client to a server module using the CAN protocol. This allows you to use events and access measurements on the server module. Follow theXCP Database and Communication Workflowto learn how to connect to a device using XCP.

You can perform a direct read from or write to the memory on the server module. Alternatively, create a dynamic data stimulation list and assign measurements to the list, then read acquired DAQ data and write stimulation data.

Functions

expand all

xcpA2L Access A2L file
getCharacteristicInfo Get information about specific characteristic from A2L file
getMeasurementInfo Get information about specific measurement from A2L file
getEventInfo Get event information about specific event from A2L file
xcpChannel Create XCP channel
connect Connect XCP channel to server module
disconnect Disconnect from server module
isConnected Connection status
readCharacteristic Read and scale specified characteristic value from direct memory
writeCharacteristic Scale and write specified characteristic value to direct memory
readMeasurement Read and scale specified measurement value from direct memory
writeMeasurement Scale and write specified measurement value to direct memory
readAxis Read and scale specified axis value from direct memory
writeAxis Scale and write specified axis value to direct memory
readSingleValue Read single sample of specified measurement from memory
writeSingleValue Write single sample to specified measurement
createMeasurementList Create measurement list for XCP channel
viewMeasurementLists View configured measurement lists on XCP channel
freeMeasurementLists Remove all measurement lists from XCP channel
startMeasurement Start configured DAQ and STIM lists
isMeasurementRunning Indicate if measurement is active
readDAQ Read scaled samples of specified measurement from DAQ list
readDAQListData Read samples of specified measurement from DAQ list
writeSTIM Write scaled value of specified measurement to STIM list
writeSTIMListData Write to specified measurement
stopMeasurement Stop configured DAQ and STIM lists

Properties

expand all

xcp.A2L Properties Properties of thexcp.A2Lfile object
xcp.Channel Properties Properties of thexcp.Channelobject

Topics

Hardware Connection

Read and Write Data to Memory

Acquire and Stimulate Measurements