This is machine translation

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

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


Create XCP channel


xcpch = xcpChannel(a2lFile,transportLayer,vendor,deviceID)
xcpch = xcpChannel(a2lFile,transportLayer,vendor,deviceID,deviceChannelIndex)


xcpch = xcpChannel(a2lFile,transportLayer,vendor,deviceID) creates a channel connected to the CAN bus via the specified transport layer, vendor, and device. The XCP channel accesses the slave module via the specified CAN bus and parsing the attached A2L file.

Use this syntax for vendors 'PEAK-System' or 'NI'. With National Instruments® CAN devices, the deviceID argument must include the interface number defined for the channel in the NI Measurement & Automation Explorer.


xcpch = xcpChannel(a2lFile,transportLayer,vendor,deviceID,deviceChannelIndex) creates a channel for vendors 'Vector', 'Kvaser', or 'MathWorks'. Specify a numeric deviceChannelIndex for the channel.


collapse all

Create an XCP channel using a Vector CAN module virtual channel.

Link an A2L file to your session.

a2l = xcpA2L('XCPSIM.a2l');

Create an XCP channel.

xcpch = xcpChannel(a2l,'CAN','Vector','Virtual 1',1)
xcpch = 

  Channel with properties:

               SlaveName: 'CPP'
             A2LFileName: 'XCPSIM.a2l'
          TransportLayer: 'CAN'
    TransportLayerDevice: [1x1 struct]
      SeedKeyCallbackFcn: []
                KeyValue: []

Input Arguments

collapse all

A2L file, specified as an xcp.A2L object, used in this connection. You can create an A2L file object using xcpA2L.

Interface used to transport XCP messages, specified as 'CAN'. Use this information to indicate the interface you are connecting to. Currently XCP works only with CAN.

Data Types: char | string

Device vendor name, specified as a character vector or string.

Example: 'Vector'

Data Types: char | string

Device on the interface to connect to, specified as a character vector or string.

For National Instruments CAN devices, this must include the interface number for the device channel, defined in the NI Measurement & Automation Explorer.

Example: 'Virtual 1'

Data Types: char | string

Index of channel on the device, specified as a numeric value.

Example: 1

Output Arguments

collapse all

XCP channel, returned as an object.

See Also


Introduced in R2013a

Was this topic helpful?