disconnect

Disconnect from slave module

Syntax

Description

example

disconnect(xcpch) disconnects the specified XCP channel from the slave module. Disconnecting the channel stops active messaging between the channel and the slave module.

Examples

expand all

Disconnect an Active XCP Connection

Create an XCP channel using a CAN module, connect the channel and disconnect it from the specified slave module.

Link an A2L file

a2l = xcpA2L('XCPSIM.a2l')

Create an XCP channel using a Vector CAN modules's virtual channel. Check to see if channel is connected.

xcpch = xcpChannel(a2lfile, 'CAN', 'Vector', 'Virtual 1', 1);

Connect the channel and check to see if channel is connected.

connect(xcpch)
isConnected(xcpch)
ans =

     1

Disconnect the channel and check if connection is active.

disconnect(xcpch)
isConnected(xcpch)
ans =

     0

Input Arguments

expand all

xcpch — XCP channelXCP channel object

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.

Was this topic helpful?